At that time, the office had already issued a broad, classified opinion declaring the president’s surveillance powers in the abstract in wartime, but it had not weighed in on the legality or the specifics of the N.S.A. operation, officials said.

The nervousness among Justice Department officials led the administration to secure a formal opinion from John Yoo, a deputy in the Office of Legal Counsel, declaring that the president’s wartime powers allowed him to order the N.S.A. to intercept international communication of terror suspects without a standard court warrant.

The opinion itself remains classified and has not been made public. It was apparently written in late 2001 or early 2002, but it was revised in 2004 by a new cast of senior lawyers at the Justice Department, who found the earlier opinion incomplete and somewhat shoddy, leaving out important case law on presidential powers. Mr. Yoo declined to discuss the issue. Even after the final legal opinions were written, lawyers at the National Security Agency were not allowed to see them, officials said.

Justice Department officials declined to comment for this article, saying that they would not discuss internal deliberations on a classified program. The White House also declined to comment. The White House is now at an impasse with the House of Representatives over Mr. Bush’s efforts to secure broader spy powers for the N.S.A. as well as retroactive immunity for the phone companies that helped in the warrantless wiretapping program. The Senate has agreed to give immunity, but the House has refused. Talks will begin anew this week when Congress returns from a two-week break.

In the past, the White House has said there was widespread agreement among administration officials about the president’s authority to order warrantless surveillance inside the United States. Former Attorney General Alberto R. Gonzales told Congress that there was never any disagreement within the administration over the issue. After it was disclosed that senior Justice Department officials had threatened to resign over aspects of the program in 2004, lawmakers attacked the truthfulness of Mr. Gonzales’s remarks, and the inspector general’s office is now reviewing his remarks as well.

In public comments of his own in 2006, Gen. Michael Hayden, who ran the N.S.A. at the start of the surveillance program and now heads the Central Intelligence Agency, recounted going to three lawyers at the security agency separately at the start of the eavesdropping program to get their legal opinions about it. All agreed that the president was within his powers to authorize the program, Mr. Hayden said. N.S.A. was “good to go,” he said he concluded.

At the insistence of Vice President Dick Cheney, knowledge of the program was restricted to a tight circle of top officials and Congressional briefings were unusually limited. But several current and former officials involved in the program said they believed the intense secrecy was to blame for much of the early nervousness among other senior officials who had integral roles in intelligence operations yet were not allowed to know the full details of what was happening.