William Mills, 42, was in tears as he walked free from the Court of Criminal Appeal in Edinburgh, and said: "I am delighted ... justice has prevailed."
He had been found guilty of an armed bank raid in 2007.
Although the robber's face had been partially covered with a mask, witnesses, including two policemen who studied CCTV images, identified him.
At his trial, Mr Mills, of Partick, Glasgow, blamed another man but failed to convince the jury. Yesterday, the appeal court was told new DNA evidence had linked that man to the crime.
Lord Gill, the Lord Justice-Clerk, sitting with Lords Eassie and Philip, said there was reasonable doubt, and they concluded Mr Mills had been victim of a miscarriage of justice. "This was a prosecution that stood or fell by eye-witness identification alone. That is a form of proof that has been shown to be, in some cases, a dangerous basis for a prosecution, as history shows," said Lord Gill.
"It is a matter of concern that an important part of the case for the prosecution was the evidence of two police officers, neither eye-witnesses, who made positive statements that Mills was the robber on the basis of looking at CCTV stills. The new evidence confirms all our reservations about this conviction."
Mr Mills had spent about a year in jail, on remand and after his trial, before being released pending his appeal. He said it was the first time he had been in prison, and he intended discussing with his solicitor, Liam O'Donnell, a possible claim for compensation.
He said: "I just wanted this to be over and done with first. My life has stood still for the last two years. I have finally been found to be innocent of a crime I never committed. It was horrible to be locked up for 23 hours a day.
"I've had no faith in the justice system since I got found guilty. I still had hope and just thought, 'Surely this can't happen to an innocent person.'"
More than 8,000 was stolen in the raid at the Royal Bank of Scotland in Dumbarton Road, Glasgow, on 24 May, 2007.
Mr Mills incriminated Michael Absalom, 38, a South African, who had been jailed for eight-and-a-half years for armed raids on an American Express office in Glasgow and a bank in Troon, Ayrshire, around the time of the Dumbarton Road raid.
DNA analysis carried out on a doorstop used by the raider to make a quick getaway was tested following the initial trial and found to match a sample from Absalom.
A source suggested it would be unlikely for Absalom to be charged with the robbery. "If doubt could be created about the identifications of Mills, the same doubt could easily be created about Absalom's DNA being found, with DNA from other unknown people, on a doorstop," he claimed.