A federal appeals court in Ohio has rejected the conviction and death sentence on Briton Kenny Richey.
Kenny Richey has been on death row for 18 years
Mr Richey has been on Death Row since 1987 after he was convicted of killing a two-year-old girl in a fire.
The 6th US Circuit Court of Appeals has ruled that he must be retried within 90 days or set free.
British politicians have campaigned on behalf of Mr Richey, 40, originally from Edinburgh. His partner said she was "delighted" by the news.
Karen Torley, who lives in Cambuslang, on the outskirts of Glasgow, told BBC Scotland: "It was a bit overwhelming to be told the decision after all this time, it was a bolt out of the blue.
"Every single one of the issues that were presented to the court have all been questioned and his conviction has been found unsafe.
"It's just been a total nightmare for him over the years, it's been hard trying to campaign to get people to see what I could see, but today's result shows it's been worth it all."
Mr Richey's US lawyer Ken Parsigian said he was overjoyed with the news.
Mr Parsigian said: "He said 'thank you, thank you, thank you' and then the word that kept coming up was 'finally'.
Karen Torley spoke to Kenny in Ohio on Tuesday evening
"He said 'I can't believe it's finally happened, finally'.
"The first thing he wants to do is get out, hug his mum, hug Karen, breathe the free air - I think all those things are going to consume his time for a while."
Alistair Carmichael, the Member of Parliament who led the campaign for Mr Richey and visited him last year, described the decision as "excellent".
He said it highlighted the flaws in the conduct of the initial trial.
"Where so much doubt exists about the safety of a conviction, it would be an offence against humanity to carry out a death sentence," Mr Carmichael declared.
"It now remains to be seen exactly what attitude the district attorney's office will take but in reaching their decision I hope that they will bear in mind that Kenny has already spent 18 years on Death Row, when the prosecutor at the time of Kenny's trial was prepared to offer a plea bargain which would have involved Kenny spending 11 years in custody."
In March last year, 150 MPs signed a Commons motion backing Mr Richey's claim of innocence and Tony Blair promised to look into the case.
The case has seen appeals on his behalf from Pope John Paul II and the former Archbishop of Canterbury.
In a resolution passed in June 1992 the European Parliament expressed its doubt concerning the validity of the sentence.
Margo MacDonald, a Member of the Scottish Parliament who has campaigned for Mr Richey's freedom, said: "It's a very bitter-sweet feeling, it's wonderful that he has managed to hold on and stay as focused as he has done.
"Imagine spending that amount of time losing your youth and knowing that you're innocent and yet he's still managed to hold onto his sanity and his focus."
Mr Richey, who has dual UK-US citizenship, left Scotland in 1981 to live with his American father in Ohio state.
Mr Richey was convicted of killing Cynthia Collins
He was convicted of killing Cynthia Collins, who died in a fire in 1986 at her mother's apartment in the town of Columbus Grove.
Prosecutors said he intended to kill his ex-girlfriend but ended up killing the child.
Three appeal court judges in Cincinnati issued a 26-page judgment on Tuesday.
In it, they said: "Because constitutional errors have undermined our confidence in the reliability of Richey's conviction and sentence, we reverse the decision."
State considers appeal
Kim Norris, spokeswoman for Attorney General Jim Petro, said lawyers were reviewing the ruling to determine whether or not to appeal. State attorneys could ask the full circuit court or the US Supreme Court to consider the case.
But Mr Richey's lawyer in Ohio and Amnesty International Scotland said they believed this was unlikely.
Amnesty's Rosemary Burnett said: "The state has 14 days to appeal but we imagine they won't appeal because the trial was flawed.
Cynthia died when her house went up in flames
"They have 90 days to set a date for a retrial or to release Kenny.
"Nobody should be sent to the living hell of death row but Kenny Richey's 18-year ordeal has come after a flawed trial and serious concerns about the Ohio justice system.
"Indeed, Kenny's case was always one of the most compelling cases of apparent innocence that human rights campaigners had ever come across."
Mr Richey has lived through 13 dates for his execution and at one point was an hour away from dying.
Last year, he told a BBC correspondent: "I'm innocent and I'll stand by that 'til the day they kill me.
"I used to be afraid of death when I was a kid, but I'm not anymore. Death doesn't bother me."