Former News of the World editor Andy Coulson has been cleared of committing perjury while giving evidence in the 2010 trial of ex-MSP Tommy Sheridan.
The Crown alleged that Mr Coulson, 47, lied about his knowledge of phone hacking at the now-defunct tabloid reports BBC.
The case against him collapsed after his defence team successfully argued there was no case to answer.
Judge Lord Burns ruled the Crown had not shown Mr Coulson’s evidence was relevant in the Sheridan trial.
Speaking outside the High Court in Edinburgh after his acquittal, Mr Coulson said: “I am obviously delighted by the judge’s decision today. It was the right decision.
“This prosecution was always wrong. I didn’t lie and the prosecution, in my view, was a gross waste of public money.
“I am just delighted that after four pretty testing years that my family and myself have finally had a good day.”
Explaining his ruling, Lord Burns told the jury that perjury was the giving of false evidence under oath which is relevant to the issues in that trial.
He said the Crown needed to prove that Mr Coulson’s allegedly false evidence in the 2010 Sheridan case was relevant to the issues in that trial, and that was for him as a judge to decide rather than the jury.
Lord Burns said that after two days of legal submissions the Crown had not satisfied him that Mr Coulson’s evidence had been relevant.
The judge formally acquitted Mr Coulson on Monday, but the acquittal was suspended and could not be reported until Wednesday morning while the Crown decided whether it would appeal.