The Vilnius Appeals Court said prosecutors failed to prove Michael Campbell's ties with the Real IRA and suggested that he was the victim of entrapment.
"There was no direct evidence proving Campbell's ties with Real IRA. He was never arrested by British or Irish authorities for terrorism-linked activities," Judge Viktoras Kazys said. "The prosecution did not provide enough evidence to deny statements that Campbell's actions were provoked by undercover MI5 agents."
Campbell's lawyer, Ingrida Botyriene, escorted Campbell to the Irish Embassy after his release. "A person cannot be sentenced for a crime committed by state officials," she said. "We will be discussing possibilities to demand compensation for my client."
Prosecutors said they would appeal Wednesday's decision.
"I would not agree with the court ruling and will present an appeal to the Supreme Court," said Lithuanian prosecutor Gedgaudas Norkunas. "This case was rather complicated indeed, but I certainly cannot agree with statements implying that the defendant was provoked to commit these criminal activities."
Two years ago, a Lithuanian court found Michael Campbell guilty of trying to buy weapons and explosives after a six-year sting operation in a case that drew attention to a hardcore Irish Republican Army splinter group's plans to spread terror to London.
According to Lithuanian prosecutors, video footage and intercepted communications showed that he paid about 6,000 euros ($8,300) for high-grade explosives, grenade launchers, detonators, AK-47s and a special assassin's rifle to Lithuanian agents posing as arms dealers.
In an audio recording, Campbell was heard discussing how easy it would be with the type of equipment on offer to plant a bomb in London and escape.
He was given prison sentences of five years for weapons possession, six years for attempting to smuggle weaponry and explosives, and 12 years for supporting a terrorist group. However, the judge at that trial said the sentences on the weapons charges would be canceled since no harm was caused and that Campbell didn't have prior convictions for similar offenses.
The Real IRA opposed Northern Ireland's Good Friday peace settlement of 1998 with a series of car bombings. In August that year the group killed 29 people in Omagh, Northern Ireland, when a car bomb detonated amid a crowd of shoppers, workers and tourists.