For more than 20 years, it was settled law, born of bitter experience, that the government may not eavesdrop on people in the United States without a warrant.

Until, that is, after the 9/11 attacks, when President George W. Bush ordered the National Security Agency to ignore the law. When The Times disclosed the spying in late 2005, Mr. Bush argued that the attacks changed everything: Due process and privacy were luxuries the country could no longer afford. Far too many members of Congress bought this argument. Others, afraid of being painted as soft on terror, refused to push back. In 2008, at the White House’s insistence, they expanded the government’s ability to eavesdrop without warrants.

Even that was not enough for the Bush administration, which insisted that targets of the earlier, illegal spying could not sue the government because what happened was “too secret” even to be discussed in court. The Obama administration has embraced the secrecy argument and has used it to block several cases.

Fortunately, it has not completely succeeded.

The chief judge of the Federal District Court in San Francisco, Vaughn Walker, ruled last week that the 1978 Foreign Intelligence Surveillance Act was the law of the land for Mr. Bush and that when the government failed to get a warrant to wiretap, it broke the law. He also said that the government could not evade accountability with absurdly broad claims of state secrets.