Every youngster in Scotland taking part in sport will be offered screening for Sudden Death Syndrome, which killed footballer Phil O'Donnell.
The Government hopes the scheme will prevent dozens of similar deaths.
The move was announced yesterday by Health Secretary Nicola Sturgeon at the SNP's spring conference in Edinburgh.
Everyone over 16 taking part in organised sport will be given the chance of being screened for cardiac abnormalities.
Ms Sturgeon said that everyone in Scotland had been shocked by Motherwell player Phil O'Donnell's death on December 29, when he collapsed during his team's match against Dundee United at Fir Park.
"Sudden Cardiac Death is rare, very rare" she said.
"But it does claim too many fit, active young lives.
"Young men are 10 times more vulnerable than women. There have been many calls since Phil O'Donnell's death to introduce heart screening for all young athletes.
"Opinion about the effectiveness of screening and there's a real need to develop a proper evidence base," she added.
"Professional sportsmen and women can often access screening tests through their sporting bodies but there's currently no access at all for non-professionals.
"So I can announce the Government is working with the Scottish Football Association to establish a pilot programme that will provide, for the first time, a free screening service for amateur athletes in Scotland."
The pilot will involve Scottish Government investment in the sports medicine centre at Hampden Stadium, to create the extra capacity needed to offer this screening to over-16s who are active in amateur sports."
The Government has drawn up the scheme with the help of SFA Chief Executive Gordon Smith, SFA medical Officer Professor Stuart Hillis and Chief Medical Officer for Scotland Harry Burns.
Professor Hillis will direct the scheme from Hampden.
Initially, youngster taking part in football and rugby will be screened during the trial period, with screening being eventually rolled out across other sports. It's expected to cost around £100,000 a year during the pilot programme.
Sudden Cardiac Death is thought to affect around one person in 200,000, thought the English organisation Cardiac Death in Youth* (Cardiac Risk in the Young ) believes the figure is much higher. Similar screening programmes already operate in the United States and in Italy.
Sports Minister Stewart Maxwell said this was a scheme that would save young lives. He added, "Part of the problem is we don't know how many people if affects."
MSP Dr Ian McKee, a former GP, said Sudden Death Syndrome was caused by cardiomyopathy disease of the heart muscle, which hadn't been diagnosed.
The screening will have three main elements. First there will be a questionnaire to determine whether there are family heart problems. Then there's an EGG test to detect any heart abnormality, and finally ultrasound, which can detect things like holes in the heart.