WASHINGTON — The House passed a bipartisan bill that would preserve surveillance authority for counterterrorism investigations and add oversight to the process but wouldn't deliver sweeping reforms demanded by privacy and civil liberties advocates.

The House passed the bill on a 278-136 vote Wednesday, just days before key surveillance laws are set to expire. But the bill's future is uncertain in the Senate, where leaders have acknowledged they are unlikely to pass the measure before the provisions expire Sunday.

At least two senators, who say the bill falls short of protecting privacy rights of Americans, have threatened to block it. President Donald Trump, who has attacked the FBI's surveillance of his 2016 campaign as it investigated Russian election interference, hinted at a veto Thursday.

Key Senate Republicans, including Senate Majority Leader Mitch McConnell of Kentucky, have urged their colleagues to back the bill. Without an agreement, key provisions of the Foreign Intelligence Surveillance Act, or FISA, that are used to investigate foreign terrorists and espionage will expire. The bill reauthorizes those provisions until Dec. 1, 2023.

It's not clear exactly how long of a gap there will be before Senate leaders gather enough support. "Eventually, you know, we're gonna have the votes to pass it," Senate Majority Whip John Thune, R-South Dakota, told reporters Thursday, adding that there could be some amendments.

The rare compromise between Republicans and Democrats follows weeks of negotiations over whether to overhaul the country's surveillance laws. It follows an inspector general's report revealing fundamental errors and misstatements in the FBI's controversial surveillance of a former Trump campaign aide.

The bill would stiffen criminal penalties for making false statements to the secret court that weighs surveillance requests and give the attorney general authority to sign off on surveillance requests of elected officials and federal candidates. It also would permanently end a controversial program that collected metadata on phone calls, including more than 430 million in 2018. The National Security Agency has since suspended that program.

Attorney General William Barr, who also supports the measure, said it "will protect against abuse and misuse in the future while ensuring that this critical tool is available when appropriate to protect the safety of the American people."

Calls to overhaul surveillance laws gained momentum last year after the Justice Department's inspector general revealed several errors in the FBI's applications to wiretap former Trump campaign adviser Carter Page.

A rare rebuke:Judge says the FBI misled FISA court when seeking permission to wiretap a former Trump campaign aide

The three expiring provisions are part of an expansion of the government's surveillance powers after the September 11 terrorist attacks. They were not part of the FBI's surveillance of Page during the Russia investigation.

The proposed legislation would preserve the so-called "business records" provision that allows the government to obtain information from third parties, such as phone and Internet providers, for national security investigations. It would retain access to "roving wiretaps," which allow the government to eavesdrop on those who switch phone numbers or acquire "burner" phones to avoid detection. And it would maintain the "lone wolf" provision that allows investigators to monitor foreigners in the U.S. who are suspected of aiding foreign terrorists but are not connected to international terrorist organizations.

Negotiations over the FISA law became thorny after Justice Department Inspector General Michael Horowitz found in December that investigators had inflated their justification to monitor Page.

In a blistering report, the inspector general concluded that the FBI omitted information that undermined their suspicions, it overstated the reliability of a former British intelligence officer whose information they used to justify the warrants, and it did not submit documents to back up agents' assertions.

Horowitz's voluminous report debunked claims by Trump and his allies that political bias played a role in the Russia investigation. At the same time, it revealed a systemic and equally troubling problem, experts said, and raised questions about the accuracy of more than 1,000 wiretap applications processed every year under the Foreign Intelligence Surveillance Act.

Since the report was released, FBI Director Christopher Wray has announced more than 40 reforms, including additional verification of agents' assertions, more documentation, training and internal audits.

The secretive court that approves sensitive surveillance operations issued a rare rebuke of the FBI, saying the bureau misled the Justice Department and the court when it sought permission to wiretap Page.

Last week, Judge James Boasberg of the Foreign Intelligence Surveillance Court barred DOJ and FBI employees who are "under disciplinary or criminal review" as a result of the Page surveillance from participating in the FISA process before the court.

FISA:FBI wiretap of Trump campaign aide was riddled with errors, but Russia probe was legally justified, IG report finds

Across Pennsylvania Avenue, negotiations continued for weeks as the expiration date for the FISA provisions loomed.

Barr has shouldered much of the burden of brokering a deal to preserve FISA, casting it as critical to law enforcement.

Late last month, Barr took his case to GOP senators, who pushed back against his efforts. Perhaps the strongest resistance came from Lee, who said Barr's pledge to create internal controls was "not good enough."

Republicans, including some of Trump's fiercest allies, have argued the surveillance law was used to carry out an attack on the Trump campaign. Without massive reforms, they threatened to allow the surveillance powers to expire.

In a statement, Republican leaders in the Senate, including McConnell, Thune, Judiciary Chairman Lindsey Graham of South Carolina and Intelligence Committee Chairman Richard Burr of North Carolina, lauded the House action.

“Our nation’s national security professionals and intelligence community work every day to confront grave threats, protect American lives from foreign terrorism, and counter espionage by hostile powers such as China and Russia," they said. "They are not complacent, and Congress must not be either. The safety and security which these regularly-used authorities have helped preserve should not be misunderstood as evidence they are no longer needed. To the contrary, it is evidence of their necessity."

But others are not satisfied.

Rep. Zoe Lofgren, D-Calif., said by reauthorizing the "business records" provision, the bill would still allow intelligence agencies to collect vast amounts of private information on Americans.

Two privacy hawks in the Senate, Rand Paul of Kentucky and Mike Lee of Utah, also voiced their opposition, saying the bill does not go far enough to guard against abuse. They urged Trump to veto the measure if it reaches his desk.

Elizabeth Goitein of the Brennan Center for Justice, said instead of meaningful civil liberties reforms, the bill includes a "series of 'Carter Page' fixes designed to appeal to conservative lawmakers."

"FISA is too important, and its impact on Americans’ privacy rights too significant, to bypass regular procedure and rush through a weak reform bill, Goitein said. "Civil liberties shouldn’t be held hostage to deadlines."

In a letter to House members Wednesday, the American Civil Liberties Union said the reforms contained in the bill are "minimal" and largely a "codification of the status quo." The group urged Congress to extend the expiring provisions by six weeks to allow lawmakers to come up with a more meaningful reform bill.

Contributing: Christal Hayes