"I think that it may sound odd, but I enjoy coming out here when it is challenging because I think this is a portion of our democracy at work," he said. The secret investigation into AP seems to represent the largest government intrusion into the operations of a news organisation in American history. "If there is a bigger one," says Mark Jurkowitz of the Pew Research Project for Excellence in Journalism, "we don't know about it." On Tuesday, more than 50 media groups signed a letter of protest that said in part that the dragnet "calls into question the very integrity of Department of Justice policies toward the press and its ability to balance, on its own, its police powers against the First Amendment rights of the news media and the public's interest". In a nation with a reverence for its Bill of Rights, particularly the First Amendment right to freedom of speech, the action was particularly shocking. The department's excursion into domestic spying has its origin in a stunningly successful espionage operation launched more than a year earlier in Yemen. An al-Qaeda affiliate had hatched a plan to place a suicide bomber wearing a device built into his underwear on a commercial flight bound for the US. What it didn't know was that the man they selected to wear the bomb was a double agent working for Saudi Arabia and co-operating with the CIA. After weeks inside the terrorism cell, the double agent provided the bomb to the CIA. Information he passed on led to a drone strike that killed Fahd Mohammed Ahmed al-Quso, the group's operations director and a suspect in the bombing of the US navy destroyer USS Cole in 2000.

The double agent made it back to safety in Saudi Arabia while the FBI studied the device at its laboratory at Quantico, Virginia. The importance of the intelligence coup is hard to exaggerate. Not only was an attack thwarted, the device was the work of the group's leading bomb-maker, Ibrahim Hassan al-Asiri. He is also believed to have designed the explosives used in the failed bombing attempt of an plane over Detroit in 2009, and those packed into printer cartridges and placed on cargo planes in October 2010. The operation might well have remained one of the silent victories in the war against terrorism had AP not got wind of it, and published a story that included details of the thwarted bombing and the device. These records potentially reveal communications with confidential sources. Barack Obama AP agreed to hold publication for a few days, but finally ran the story on May 7 last year.

The intelligence community was furious. Later reports suggested agencies had hoped the operation might continue for weeks. As other news outlets pursued the story they uncovered further information, including the involvement of Britain's MI5 and MI6. Tensions over leaks have long existed between American and British intelligence agencies and it was feared revelations about the Yemen operation might disturb further collaborations. As the election campaign in the US heated up, Republicans blamed the Obama administration of orchestrating the leaks to buff its anti-terrorism credentials. The Republican chairman of the House intelligence committee Mike Rogers announced a "preliminary review" of leaks about the operation, as investigations were launched by the White House, the Director of National Intelligence and the FBI. Last Friday, AP's lawyers received a terse letter from the Department of Justice informing them its phone records had been secretly obtained.

In an angry response on Monday, AP chief executive Gary Pruitt wrote to the Department of Justice head, attorney-general Eric Holder, saying: "There can be no possible justification for such an overbroad collection of the telephone communications of The Associated Press and its reporters. "These records potentially reveal communications with confidential sources across all of the news gathering activities undertaken by The AP during a two-month period, provide a road map to AP's news gathering operations, and disclose information about AP's activities and operations that the government has no conceivable right to know." The revelation could not have come at a worse time for Obama, given that the IRS scandal the media were already pursuing also appeared to reveal over-reach by a government agency. Nonetheless the President has declined to back away from the investigation, saying at a press conference on Thursday, that he made "no apologies" for his administration's investigation into threats against national security. "I don't think the American people would expect me as commander-in-chief not to be concerned about information that might compromise their missions or might get [service people] killed." But, he added, "The flip side of it is we also live in a democracy where a free press, free expression and the open flow of information helps hold me accountable, helps hold our government accountable and helps our democracy function." To what extent the investigation will thwart the media's role of scrutinising government in future is unknowable, says Pew's Mark Jurkowitz. But he says it is clear that if whistleblowers and other confidential sources begin to believe reporters cannot protect their anonymity they may not come forward so readily.

The revelation of the seizure has had the startling effect of uniting voices from the left and right of America's media with congressional Republicans and even some Democrats condemning the President. "The burden is always on the government when they go after private information, especially information regarding the press or its confidential sources . . . On the face of it, I am concerned that the government may not have met that burden. I am very troubled by these allegations and want to hear the government's explanation," said Senator Patrick Leahy, the Democratic chairman of the Senate judiciary committee. "The Fourth Amendment is not just a protection against unreasonable searches and seizures, it is a fundamental protection for the First Amendment and all other constitutional rights . . . We must guard it with all the vigour that we guard other constitutional protections," said the Republican firebrand senator Rand Paul. It seems the criticism is having an impact. On Wednesday, the President pushed for the introduction of a "shield law" that would allow some legal redress for journalists who are compelled to hand over information. The Daily Beast called it the legislative equivalent of a dozen roses and an "I'm sorry" card.