The Senate plan also adds one provision considered critical by the White House: shielding phone companies from any legal liability for their roles in the eavesdropping program approved by Mr. Bush after the Sept. 11 attacks. The program allowed the National Security Agency to eavesdrop without warrants on the international communications of Americans suspected of having ties to Al Qaeda.

AT&T and other major phone companies are facing some 40 lawsuits from customers who claim their actions were illegal. The Bush administration maintains that if the suits are allowed to continue in court, they could bankrupt the companies and discourage them from cooperating in future intelligence operations.

The House approved a surveillance bill in November that intentionally left out immunity for the phone companies, and leaders from the two chambers will now have to find a way to work out significant differences between their two bills.

Democratic opponents, led by Senators Russ Feingold of Wisconsin and Christopher J. Dodd of Connecticut, argued that the plan effectively rewarded phone companies by providing them with legal insulation for actions that violated longstanding law and their own privacy obligations to their customers. But immunity supporters said the phone carriers acted out of patriotism after the Sept. 11 attacks in complying with what they believed in good faith was a legally binding order from the president.

“This, I believe, is the right way to go for the security of the nation,” said Senator John D. Rockefeller, the West Virginia Democrat who leads the intelligence committee. His support for the plan, after intense negotiations with the White House and his Republican colleagues, was considered critical to its passage but drew criticism from civil liberties groups because of $42,000 in contributions that Mr. Rockefeller received last year from AT&T and Verizon executives.

Senator Olympia J. Snowe, a Maine Republican on the intelligence panel, said the bill struck the right balance between protecting the rights of Americans and protecting the country “from terrorism and other foreign threats.”

Democratic opponents, who six months ago vowed to undo the results of the August surveillance vote, said they were deeply disappointed by the defection of 19 Democrats who backed the bill.