The Official Secrets Act, which Tony Blair and other senior cabinet members voted against in Opposition, but tried to enforce in government, had been found to be incompatible with European law, and the pressure for reform is now likely to become intense.
Mr Shayler, described as "a born rebel", a "blabbermouth" and "troublemaker", had managed to cast himself successfully as a whistleblower acting in the public interest, even though he had profited from his revelations by selling them to a newspaper.
He will now be enshrined as a thorn in the side of the secret services establishment who got away with it, in the same way that Peter Wright became for the Thatcher government in 1987. Wright's book, Spycatcher, accused MI5 of plotting to oust Harold Wilson as prime minister and disclosed that the MI5 chief Sir Roger Hollis was suspected of helping the KGB.
Although the government obtained injunctions against British newspapers reporting the book's contents, Mr Wright was living in Australia and the courts there refused to ban publication.
As long as he stays abroad, Mr Shayler is in a similar position and remains at liberty to tell all. If he does make more money from his notoriety, some may think he has earned it - having been effectively on the run, or in prison, for more than a year since first deciding to break cover. What is certain is that life for him, and for the secret services, will not be the same again.
It seems that he was always an unlikely servant of the state, having demonstrated his willingness to challenge authority by publishing extracts of Spycatcher in a student newspaper at Dundee University.
He had a brief, unsuccessful attempt at journalism, being sacked only six months into a Sunday Times trainee scheme. He joined MI5, aged 24, resigning last year.
It was in the summer of 1997 that his story began in earnest, when he published a series of damaging allegations about life in MI5, quoting his disillusionment with the service as justification. Although he never rose high in the organisation in the six years he was there, he complained that it was stifled with red-tape and bureaucracy and cited frequent drunkenness among its members.
He also revealed that the service had kept files on several members of the Cabinet - including Jack Straw, the Home Secretary, and Peter Mandelson, Secretary of State for Trade and Industry, on the basis that their radical past had made them potential subversives. Other unlikely revolutionaries included John Lennon and the rock groups UB40 and the Sex Pistols.
In November, he made the damning allegation that incompetence within the service had failed to prevent the bombing of the Israeli Embassy in London in July 1994.
The claim was rebutted by Mr Straw, who said he was satisfied MI5 had received no information that could have prevented the attack. Mr Shayler also claimed that similar blunders had allowed the IRA to carry out a number of "spectaculars", or bomb attacks, in mainland Britain.
His best, though, was yet to come with further allegations that the secret services had planned and supported an assassination attempt on Colonel Gaddafi of Libya, in which innocent civilians had been killed. When this did surface through reports in the foreign press, it was again strenuously denied.
By then he was long gone from Britain, having fled to Europe with his girlfriend, Annie Machon, also a former MI5 agent, to avoid the police investigation launched into breaches of the Official Secrets Act. They settled in a cottage in rural France, where journalists were occasionally taken for updates after being blindfolded.
Mr Shayler said that he had tried to negotiate with the British authorities to drop their investigation into him, but eventually he ran out of patience and decided to go ahead with the Gaddafi revelations. Further newspaper interviews were set up, and the story was due to be broadcast to the world via Mr Shayler's own website.
But before the news could break, the Government had secured gagging orders and the French authorities were primed to seize him with a view to extradition.
He was arrested in Paris on 1 August and the extradition proceedings, which ground to a halt yesterday, were launched. He was acquitted after his prosecution was judged to be political by the French courts.
The French constitution forbids the extradition of people wanted for political offences. But the French government, on Britain's behalf, applying for Mr Shayler's extradition last month, claimed that the concept of "political crime" had virtually ceased to exist between European Union countries. The EU was becoming one "judicial space" in which extradition should be automatic.
The Chambre d'Accusation, under the presidency of Judge Elisabeth Ponroy, rejected this argument, and accepted the submission of Mr Shayler's lawyers that his sole motive, in leaking details of MI5 shortcomings, had been to unmask the incompetence of an important state agency.
Mr Shayler remains charged in Britain with several breaches of the Official Secrets Act, including the leaking of 30 top-secret documents to The Mail on Sunday.
His lawyers had argued that this was manifestly a political act. So was the Government's decision to prosecute him, despite its admission that no vital state or defence secret had been threatened.
The fact that the Government had negotiated a possible deal with him over several months also proved that his offence was political, not criminal, they said.
John Wadham, director of the civil rights pressure group Liberty, which has supported Mr Shayler politically and financially, said last night: "The Government should now accept the decision of an independent French court that David was innocent and should drop the charges against him in Britain."
Mr Shayler's case is the latest in a succession of cases that have invoked the Official Secrets Act.
In 1984, Sarah Tisdall, a clerk in the Foreign Secretary's private office, leaked memos to The Guardian on the arrival of cruise missiles at Greenham Common. She was charged under the Act and jailed for six months in March 1984.
In 1985, Clive Ponting, an assistant secretary at the Ministry of Defence, was prosecuted for leaking documents which showed that Tory ministers had misled the Commons about the sinking of the Belgrano in the Falklands War.
He was acquitted by a jury despite a direction by the judge to convict.
Leading article, Review, page 3Reuse content