Updated

The White House and congressional negotiators on Thursday struck a deal on an overhaul of the nation's terror surveillance laws in a proposal that likely would protect telecommunications companies from dozens of lawsuits.

The House will debate the bill on Friday, potentially ending a months-long standoff about the rules for government wiretapping inside the United States. Both the House and Senate are expected to pass the bill.

House Majority Leader Steny Hoyer of Maryland said the new bill "balances the needs of our intelligence community with Americans' civil liberties, and provides critical new oversight and accountability requirements."

The biggest sticking point has been the White House's push for retroactive legal immunity for telecommunications companies that assisted the government's terror surveillance program following the Sept. 11, 2001, terror attacks.

In a key compromise, Republicans and the White House agreed to allow the legal certifications given to the phone companies to be reviewed by federal courts. The Bush administration gave the legal certifications to the telecoms to assure what they were being asked to do was legal.

About 40 lawsuits have been filed against telecommunications companies from people who believe they were the targets of illegal surveillance. The new bill would let a federal district court determine if the telecoms received lawful orders from the government asking them to place wiretaps. If so, the lawsuits would be dismissed.

But civil liberties groups and some Democrats in Congress, including Senate Minority Leader Reid, D-Nev., who does not believe the court certification goes far enough because, they say, the courts will not actually rule on whether the certifications were legal, but rather only whether the administration gave the certification to the companies.

The ACLU has called the proposed compromise review a "sham."

Speaking about the bill Thursday, House Speaker Nancy Pelosi said Democrats got their way.

"It was the unity of the Democrats that allowed us to have leverage. They (Republicans) found our members were very grounded (on the issues). When they saw our unity … I think their whole attitude changed when we stuck together. And their fear-mongering didn't work," Pelosi said.

Not all Democrats are on board, however. Sen. Russ Feingold, D-Wis., said: "The proposed FISA deal is not a compromise; it is a capitulation."

Rep. Lamar Smith, R-Texas, put the blame on Democrats for delays in reaching a compromise, but said the "bill represents a strong compromise between Republicans and Democrats, giving our intelligence officials the tools they need to keep America safe and strengthening civil liberties protections."

"Additionally, the bill offers communications providers-who assisted the government in the wake of 9-11-essential civil liability protections. ... These tools are necessary to keep America safe," said Smith, the top-ranked Republican on the House Judiciary Committee.

Sen. Jay Rockefeller, D-W.Va., said the bill "is about providing an essential tool in the fight against terrorism. It meets our dual obligations to make our nation safe and restore the privacy protections and civil liberties Americans require."

Rockefeller, chairman of the Senate Intelligence Committee, said the bill "will prevent any repeat of warrantless surveillance undertaken by the president and will hold our government accountable for its actions, past and future, through strengthened court review and congressional oversight."

The compromise bill also requires several inspectors general to investigate the wiretapping program to determine its extent and legality. The report is due in a year.

The Foreign Intelligence Surveillance Amendment bill also would:

— Require FISA court permission to wiretap Americans who are overseas

— Allow the FISA court 30 days to review existing but expiring surveillance orders before renewing them

— Prohibit the government from invoking war powers or other authorities to superseding surveillance rules in the future.

FOX News' Trish Turner and Chad Pergram and The Associated Press contributed to this report.