Former MP Natalie McGarry has had her conviction for embezzlement quashed after judges ruled she had suffered a miscarriage of justice.
Ms McGarry, 38, burst into tears at the appeal court in Edinburgh after the ruling was announced. She now faces a retrial.
In June the former SNP Glasgow East MP was jailed for 18 months for embezzling £25,000 from pro-independence groups.
At the time Ms McGarry was freed on bail after lodging an appeal.
Judges Lord Carloway, Lord Glennie and Lord Turnbull quashed the ex-politician's embezzlement convictions following a hearing at the Court of Criminal Appeal in Edinburgh.
The judges made their ruling after hearing submissions, which cannot be reported for legal reasons, from defence advocate Gordon Jackson QC.
Ms McGarry started weeping as Lord Carloway, Scotland's most senior judge, told her of the court's decision and informed her she would have to stand trial again.
She made no comment as she left court.
Ms McGarry was elected as an SNP member in 2015 but did not seek re-election in 2017.