Scot Kenny Richey has been freed from prison in the US after spending 20 years on death row.
His conviction in 1987 for starting a fire which killed two-year-old Cynthia Collins, was overturned last August.
Richey's "no contest" plea at an Ohio court on Monday was accepted and he was sentenced to time already served.
The dead toddler's aunt told Richey, now 43, that he would "burn in hell", as she made an emotional statement during the hearing.
Following his release, Richey, who was brought up in Edinburgh, said: "I'd like to thank everyone who has supported me over the years, many years.
"It's great to finally be free, at long last, and I'm looking forward to going home to Scotland. It's been a long time coming"
Richey is expected to arrive in Edinburgh on Wednesday, after flying back to the UK on Tuesday, said his lawyer, Ken Parsigian.
He was due to stay with his brother on Monday night.
Appearing before the court, smartly dressed, but in handcuffs, Richey entered a plea of no contest - which is not an admission of guilt - to attempted involuntary manslaughter, child endangering and breaking and entering.
Prosecutors claimed Richey, who has always protested his innocence, had started the fire as a jealous attack on his former girlfriend and her new lover, who lived in the flat beneath.
He refused a plea bargain which would have led to an 11-year sentence for arson and manslaughter.
In court, Cynthia Collins' aunt, Valerie Binkley, attempted to read a statement but broke down.
"How do you go about putting into words what a two-year-old... means?," she said.
Two-year-old Cynthia Collins died in the fire
"I have six pages here. I know I can't make it through it, but I want you to know you fooled nobody. Not me, not that baby, not any of these people. You will burn in hell."
The court also heard a statement in the name of Robert Collins', Cynthia's father, in which he described the death as an "ongoing nightmare."
Reading the comments on his behalf, Shelly Price, of the organisation Crime Victim Services, said: "The situation surrounding the death of my little girl has haunted me for 21 years.
"I try not to think about how she died, but it consumes my thoughts.
"The unthinkable reality of her choking, crawling, crying and her little lungs filling with smoke has been etched in my mind since her death."
He said his daughter did not deserve to die and said he would never achieve closure over her death.
The statement ended: "I just wish Cynthia could appeal her death and come back to life."
During the court hearing, Judge Alan Travis also said Richey would be subject to a Civil Protection Order which prevents him from contacting certain people, who were not named.
He also said the Scot would not be allowed to return to Putnam County for five years but said this basically meant he would be agreeing never to go back there.
Richey's mother Eileen said she was "ecstatic" at the news of his release.
Karen Torley, who has been campaigning for Richey's release, said he would need support once he returned to society.
"He's been on his own most of that time," she said. "He didn't get to mix with very many people very often.
"Kenny's got a sense of humour which will get him along some of the way, but he will need some help."