After months of wrangling, Democratic and Republican leaders in Congress have struck a deal to overhaul the rules on the government's wiretapping powers and provide what amounts to legal immunity to the phone companies that took part in President George W. Bush's program of eavesdropping without warrants after the Sept. 11, 2001, attacks.
The House of Representatives on Friday approved the update to the intelligence law by a vote of 293 to 129. The Senate is expected to pass the bill with a large margin, perhaps as soon as next week.
The deal reached Thursday, expanding the government's powers to spy on terrorism suspects in some major respects, would strengthen the ability of intelligence officials to eavesdrop on foreign targets. It would also allow them to conduct emergency wiretaps without court orders on American targets for a week if it is determined that important national security information would otherwise be lost. The agreement would be the most significant revision of surveillance law in 30 years.
The agreement would settle one of the thorniest issues in dispute by providing immunity to the phone companies in the Sept. 11 program as long as a federal district court determined that they received legitimate requests from the government directing their participation in the program of wiretapping without warrants.
With some AT&T and other telecommunications companies facing about 40 lawsuits over their reported participation in the wiretapping program, Republican leaders described this narrow court review on the immunity question as a mere ''formality.''
''The lawsuits will be dismissed,'' Representative Roy Blunt of Missouri, the No. 2 Republican in the House, predicted with confidence.
The proposal - particularly the immunity provision - represents a major victory for the White House after months of dispute.
Bush on Friday praised Congress for moving forward on the compromise bill, saying ''it will help our intelligence professionals learn enemies' plans for new attacks.''
Senator Christopher Bond, Republican of Missouri, who led the negotiations, said, ''I think the White House got a better deal than even they had hoped to get.''
While passage is almost certain in Congress, the plan will nonetheless face opposition from lawmakers on both political wings, with conservatives asserting that it includes too many checks on government surveillance powers and liberals asserting that it gives legal sanction to a wiretapping program that they maintain was illegal in the first place.
Senator Russ Feingold, Democrat of Wisconsin, who pushed unsuccessfully for more civil liberties safeguards in the plan, called the deal ''a capitulation'' by his fellow Democrats.
But Democratic leaders, who squared off against the White House for more than five months over the issue and allowed a temporary surveillance measure to expire in February, called the plan a hard-fought bargain that included needed checks on governmental abuse.
''It is the result of compromise, and like any compromise is not perfect, but I believe it strikes a sound balance,'' said Representative Steny Hoyer of Maryland, the House Democratic leader who helped draft the plan.
Perhaps the most important concession that Democratic leaders claimed was an affirmation that the intelligence restrictions were the ''exclusive'' means for the executive branch to conduct wiretapping operations in terrorism and espionage cases. The speaker of the House, Nancy Pelosi, had insisted on that element, and Democratic staff members asserted that the language would prevent Bush, or any future president, from circumventing the law. The proposal asserts ''that the law is the exclusive authority and not the whim of the president of the United States,'' Pelosi said.
In the wiretapping program approved by Bush after the Sept. 11 attacks, the White House asserted that the president had the constitutional authority to act outside the courts in allowing the National Security Agency to focus on the international communications of Americans suspected of having ties to terrorists and that Congress had implicitly authorized that power when it voted to use military force against Al Qaeda.
Among other important provisions in the 114-page plan, Democrats also pointed to requirements that the inspectors general of several agencies review the security agency's wiretapping program, that the government obtain individual court orders to wiretap Americans who are outside the United States and that the secret court overseeing wiretaps give advance approval to the government's procedures for wiretapping operations.
Under a temporary plan that Congress approved last year, the court had to approve those procedures only months after wiretapping had begun.
The wiretapping plan agreed upon Thursday would expire at the end of 2012, unless Congress renewed it.
The proposal also seeks to plug what the Bush administration maintained was a dangerous loophole by no longer requiring individual warrants for wiretapping purely foreign communications, like phone calls and e-mail messages that pass through American telecommunications switches. The government would now be allowed to use broad warrants to eavesdrop on large groups of foreign targets at once.
In targeting and wiretapping Americans, the administration would have to get individual court orders from the intelligence court, but in ''exigent'' or emergency circumstances it would be able to go ahead for at least seven days without a court order if it asserted that ''intelligence important to the national security of the United States may be lost.''
White House officials said that the new emergency provisions applied only to foreign wiretapping, but Democratic officials said they interpreted the proposal to apply to domestic surveillance operations as well.
Under the current law, the government can conduct an emergency wiretap for only three days, but Democrats maintained that the new seven-day allowance included tougher standards for the government to meet in asserting an emergency.
The arcane details of the proposal amount to a major overhaul of the landmark surveillance law known as the Foreign Intelligence Surveillance Act, which Congress passed in 1978 after the abuses of the Watergate era. But much of the debate over the bill in the past six months has been dominated by the separate question of whether to protect the phone companies from legal liability for their role in the eavesdropping program.
On that score, the bipartisan proposal marks a clear victory for the White House and the phone companies.