Congress passed and President Obama signed legislation reauthorizing the USA Patriot Act just hours before three controversial provisions were due to expire.

But in a rare meeting of minds, many liberals and some tea party activists opposed the bill on the grounds that it gives the government too much power and does not protect civil liberties. The Senate passed the bill on Thursday 72 to 23, after working through objections by Sen. Rand Paul (R) of Kentucky.

The vote also cut across party lines in the House, where the measure passed on Thursday 250 to 153, with 31 Republicans and 122 Democrats voting in opposition.

Speaker John Boehner (R) of Ohio called the bill “a critical tool” to protect the American people. Democratic leader Nancy Pelosi of California, meanwhile, said that Congress had failed “to preserve Americans’ privacy” and missed an opportunity to reform “documented abuses” in the law.

On the Senate side, majority leader Harry Reid (D) of Nevada blasted Senator Paul for putting the nation’s security at risk by delaying the bill.

Few laws have so consistently been associated with haste and fear as the USA Patriot Act, which first passed the Congress as ground zero still smoldered after the 9/11 attacks. At the time, the Bush administration warned that new terrorist attacks could take place within days – and that if Congress did not grant government significant new powers of surveillance, lawmakers would be accountable for the attacks. The USA Patriot Act passed the Senate on Oct. 24, 2001, with just one dissenting vote, and later cleared the House by a vote of 357 to 66.

But Congress also included sunset provisions to ensure that lawmakers revisited these measures, outside such a climate of crisis. Over time, nearly all these sunset provisions have been made a permanent part of the law.

Here are three provisions that Congress took up this week and extended for four years:

• Roving wiretaps. This provision gives intelligence officials authority to conduct surveillance on terrorist suspects regardless of how many communication devices they use (such as cellphones or the Internet). Approval for the surveillance must be obtained from a federal court. Law-enforcement agencies have been able to use wiretaps for criminal investigations since 1986.

• Business records. Another provision allows access to business records in cases involving terrorism, foreign intelligence, or espionage, with approval of a federal judge.

• Lone wolf. In 2004, Congress amended the Foreign Intelligence Surveillance Act to authorize intelligence gathering on individuals not affiliated with any known terrorist organization, with a sunset date to correspond with the Patriot Act provisions. The provision, which is thus technically not part of the Patriot Act, is explicit in saying it does not to apply to US citizens.

On Wednesday, Director of National Intelligence James Clapper wrote to congressional leaders warning that any lapse in the provisions of the law carried national security risks, especially following the killing of Osama bin Laden.

“The information obtained at the Osama Bin Laden compound must be quickly analyzed for any indications and warning of terrorist plots and attack plans,” he wrote. “As part of this effort we are using all our collection authorities to investigate and prevent terrorist attacks.”

But privacy groups say that Congress has never done a thorough investigation of how the law actually works, especially its impact on individual privacy rights.

“Despite having months to debate and legislate on this crucial issue, Congress has once again chosen to rubberstamp the Patriot Act and its overreaching provisions,” said Laura Murphy, director of the Washington legislative office of the American Civil Liberties Union, in a statement. “Since its passage nearly a decade ago, the Patriot Act has been used improperly again and again by law enforcement to invade Americans’ privacy and violate their constitutional rights.”

As for Paul, he had held out for an amendment that would have limited access to gun records under the Patriot Act. “There is no reason we should allow a government to look at our gun records and to troll through all of them,” the senator said on the floor Wednesday. “If a government thinks someone is a terrorist, name that person, name the place, and show probable cause.”

In a surprise move, the National Rifle Association declined to take a position on the amendment, which was blocked on a procedural vote, 85 to 10.