British prosecutors have dropped seven terror charges against former Guantanamo Bay detainee Moazzam Begg relating to the conflict in Syria.
The 45-year-old has been in custody since March awaiting a trial, which was due to start on Monday, but has now walked out of Belmarsh prison in south east London.
The Crown Prosecution Service made the dramatic announcement during a pre-trial review at the Old Bailey court in London, where Mr Begg was appearing via videolink from the high security Belmarsh prison.
"The prosecution have recently become aware of relevant material and in light of which, after careful and anxious consideration, have reached the conclusion that there is no longer a realistic prospect of conviction in this case," prosecuting lawyer Christopher Hehir said.
In response, Judge Alan Fraser Wilkie said: "On the indication of the Crown offering no evidence, verdicts of not guilty should be entered."
Mr Begg was arrested in February at his home, accused of providing terrorist training between October 2012 and April 2013, and funding terrorism between July and August 2013.
His arrest caused headlines because of his high profile, and police conceded that questions were now going to be asked about why he was charged in the first place.
Born in Britain, Mr Begg fought in Bosnia in the 1990s and moved with his family to Afghanistan in 2001.
He was detained in Pakistan in January 2002 and spent nearly a year at Bagram airbase in Afghanistan, before being sent to the notorious US detention camp at Guantanamo Bay in Cuba until his release without charge in January 2005.
Returning to Britain, he became director of a human rights organisation, CAGE, and a vocal critic of the rights of those detained under the so-called "War on Terror".
After the Arab Spring, he visited Syria twice, as well as Egypt, Tunisia and Libya, to conduct what he said were investigations into the British government's role in human rights violations, according to CAGE.
His lawyer Ben Emmerson said he made no secret of his visits to Syria but was not guilty of terrorism.
"Mr Begg did not train anyone for the purposes of terrorism as defined in the 2001 act," Emmerson told the court.
"Mr Begg says he was involved in training young men to defend civilians against war crimes by the Assad regime."
Asked how he felt about the charges being dropped, Mr Begg told reporters: "I wanted my day in court but I was very happy."