A Scottish man who has spent 20 years on death row in the US for the murder of a two-year-old girl is set to be freed after agreeing a plea bargain.
Kenny Richey, whose conviction was overturned, will plead no contest to attempted involuntary manslaughter and child endangering.
He was convicted in 1987 of an arson attack on an apartment block in an Ohio town which killed Cynthia Collins.
It is thought he will enter a plea on Thursday and then return to Scotland.
The plea would see him being sentenced to time already served.
His conviction was overturned on appeal for the second time by a US court in August this year, bringing the prospect of a retrial.
Richey's lawyer Ken Parsigian said: "It is a complete victory and more than Kenny and I could ever wish for.
"Kenny is thrilled but a little nervous."
Mr Parsigian said Richey had spoken to his mother Eileen, who lives in Edinburgh, his father and his brother.
They were said to be "delighted" with the news.
Two-year-old Cynthia Collins died in the fire in 1986
A no contest plea is not an admission of guilt, but a statement that no defence will be presented.
It is treated like a guilty plea by courts.
Mr Parsigian said the plea deal was "as close to the state admitting it was wrong as we are going to get".
He added that Richey was planning to fly back to Edinburgh on Friday.
Karen Torley, his ex-fiancée and head of the Kenny Richey Campaign, said the plea was a face-saving exercise for prosecutors.
She said Richey was upbeat but anxious about the journey home.
"I always knew this day would come, it is just that when it happened it happened so quickly and out of the blue. It took your breath away," she added.
Campaign group Reprieve has been working for years to secure Richey's release.
Reprieve's legal director Clive Stafford Smith said the case epitomized what was wrong with capital punishment.
Mr Stafford Smith said: "An innocent man gets a death sentence because he had an incompetent lawyer at trial, his conviction is reversed two decades later, and then he has to enter a plea to avoid a second death sentence.
"It was the right thing to do - nobody can expect him to trust a system that already got it so terribly wrong - but it's an insane process nevertheless."
Richey had always denied murdering his former girlfriend's two-year-old daughter, Cynthia Collins.
He was found guilty of starting a fire at the toddler's mother's apartment in the town of Columbus Grove in 1986.
The case has attracted appeals on Richey's behalf from Pope John Paul II and the former Archbishop of Canterbury.