The government is desperately looking for a way out of the David Shayler affair, with a growing number of Labour MPs warning ministers of the dangers of a re-run of the Spycatcher fiasco when attempts by the Thatcher administration to prevent journalists disclosing information about MI5 collapsed after an expensive and futile court battle.

Court injunctions have failed to prevent a stream of embarrassing allegations from Mr Shayler, the former MI5 officer living in Paris, notably about MI6 involvement in a plot to assassinate the Libyan leader, Colonel Gadafy.

The security and intelligence agencies have been unable to suppress information on the internet, including a MI6 report on the Gadafy plot and the names of MI6 and MI5 officers.

The Metropolitan police special branch is now being blamed for raising the ante by threatening the Guardian and the Observer with prosecution under the Official Secrets Act for publishing information from Mr Shayler. Robin Cook, foreign secretary, and Peter Hain, Foreign Office minister, have let it be known they were horrified by the action.

With both newspapers challenging the decision by Martin Stephens, an Old Bailey judge, to order them to hand over any emails or notes they may have relating to Mr Shayler, Jack Straw and MI5 are distancing themselves from the police action. The newspaper have made it clear they are ready to take the case to the European court of human rights.

MPs are also uneasy about the arrest of Julie Ann Davies, a student at Kingston University, in south west London, in connection with the Shayler affair.

The government's attempt to extradite Mr Shayler was dismissed by a French court two years ago on the grounds that its motive was political.

John Wadham, director of the civil rights group, Liberty, and Mr Shayler's lawyer, has sought private meetings with ministers and the attorney-general, Lord Williams, but has so far been rebuffed.

MI5, meanwhile, is bracing itself for sharp criticism by the parliamentary intelligence and security committee for "usurping" the role of the government's law officers by deciding not to prosecute Melita Norwood, who was unmasked as a former KGB contact.