A man found guilty of a 2004 murder is to be freed on bail after the prosecution announced it was not opposing his appeal against conviction.
Sam Hallam, 24, was present in the dock at the Court of Appeal in London for the dramatic turn of events.
There were cheers and tears in the public gallery as Lady Justice Hallett said the court would give its ruling in the case on Thursday - but that Hallam would be released on bail on Wednesday afternoon.
Earlier, the court heard from his QC that Hallam was the victim of a "serious miscarriage of justice".
Hallam was 18 when sentenced to life at the Old Bailey in 2005 and is now 24.
He was convicted of the murder of trainee chef Essayas Kassahun, 21, who died after being attacked by a group of youths on the St Luke's estate in Clerkenwell, London, in October 2004.
After announcing the granting of bail, Lady Justice Hallett turned to the dock and asked Hallam: "Do you understand what is going on? Are you sure you are all right?".
The judge explained to him that "we have to go on with the hearing", adding: "That is what we have to do."
Smartly-dressed Hallam stayed in the dock as the judges continued to hear submissions from his QC Henry Blaxland.
At the outset of the proceedings Mr Blaxland told lady Justice Hallett, sitting with Mr Justice Openshaw and Mr Justice Spencer, that a miscarriage of justice was brought about by a combination of factors - including failure by the police to properly investigate Hallam's alibi and by non-disclosure of material by the prosecution that "could have supported his case".