Washington (CNN) -- President Barack Obama signed legislation Thursday evening extending several key provisions of the Patriot Act shortly before they were set to expire at midnight.
The provisions -- passed after the September 11, 2001, terrorist attack -- deal with roving wiretaps, the tracking of alleged "lone wolf" terrorists, and the ability of law enforcement officials to obtain records they deem relevant to an investigation after securing an order from a federal court.
The bill passed both the House of Representatives and the Senate earlier in the day.
Obama, currently on a trip to Europe, directed the use of an autopen -- a signature reproduction device -- to sign the measure, according to White House spokesman Nick Shapiro.
The House was forced to briefly delay the start of its Memorial Day recess to vote on the measure. A protracted dispute over the legislation in the Senate, fueled by conservative newcomer Sen. Rand Paul, R-Kentucky, muddied voting schedules.
Paul reached a deal with Senate leaders to allow votes on whether to table two of his amendments. Both amendments failed, and the subsequent Senate vote on the measure to extend the Patriot Act provisions for four years passed easily on a 72-23 vote.
The 250-153 House vote was tighter, with lawmakers on the right and left opposing an extension for various reasons. For example, some members of Congress are concerned about the law's impact on civil liberties, while others support the law but think it should be made permanent.
One of the three provisions, Section 206 of the Patriot Act, provides for roving wiretap surveillance of targets who try to thwart Foreign Intelligence Surveillance Act (FISA) surveillance. Without such roving wiretap authority, investigators would be forced to seek a new court order each time they need to change the location, phone or computer that needs to be monitored.
Another provision, Section 215 of the Patriot Act, allows the FBI to apply to the FISA court to issue orders granting the government access to any tangible items in foreign intelligence, international terrorism and clandestine intelligence cases.
The third provision, Section 6001 of the Intelligence Reform and Terrorist Prevention Act of 2004, closes a loophole that could allow individual terrorists not affiliated with specific organizations to slip through the cracks of FISA surveillance. Law enforcement officials refer to it as the "lone wolf" provision.
Legislators opposed to the extensions claim that the provisions -- particularly related to wiretapping -- are intrusive and unconstitutional. Supporters argue that they are a critical component of U.S. anti-terror operations.
Paul, a favorite of the Tea Party movement, engaged in a bitter showdown Wednesday with Senate Majority Harry Reid, D-Nevada, who sought to limit the number of amendments that Paul could offer.
Then on Thursday, Paul complained that it was Senate Republican leaders now holding up consideration of his amendments.
In a rare public rebuke of his own party's leadership, Paul said he was "disappointed" by their actions and urged people to contact GOP leadership offices in protest.
"I've been working for two long days filibustering the Patriot Act in hopes that we can have a constitutional debate over certain provisions of it and we can try to reform it to take away some of the encroachments on our freedoms," Paul said. "Unfortunately, what we're finding now is that the Democrats have agreed to allow me to have amendments, but my own party is refusing to allow me to debate or present my amendments."
In particular, Paul sought to propose an amendment preventing warrantless access to some gun records. Republican leaders don't want a vote on his amendment because they are conflicted by it, Paul said.
They don't want to vote to weaken the Patriot Act by making it more difficult for law enforcement to obtain any information -- including gun records -- related to a terrorism investigation, he said, but they also don't want to take a vote that could be viewed negatively by gun rights groups.
One Senate Republican leader, Sen. Jon Kyl of Arizona, rejected Paul's analysis but refused to explain why or even if GOP leaders were blocking Paul's amendment.
After reaching the deal to debate two of his amendments, Paul said on the Senate floor that his motivation was to protect personal liberties rather than to harm the Patriot Act or undermine security in any way.
"It's very important that we are always vigilant, that we are eternally vigilant about the powers of government," Paul said in arguing for tighter restrictions on the ability of federal investigators to access some gun ownership records.
He went on to complain in general about what he characterized as a federal overreaction to the 9/11 attacks that reduced individual liberty in the name of security. For example, he said, airline travelers are all considered possible terrorists and screened for security reasons; he described such a strategy as a "shotgun" approach.
"Are we so afraid that we're giving up all of our liberty for security?" Paul asked, calling for tighter restrictions on what the government can investigate without a search warrant.
However, fellow conservative Sen. Saxby Chambliss, R-Georgia, said Paul's amendment to end warrantless access to gun records would hinder the government's ability to prevent terrorist attacks within the United States.
"I don't understand why we would take this tool away from national security investigators," Chambliss said, adding that there have been "no reports that the government has ever used these provisions to violate anyone's Second Amendment rights."
CNN's Deirdre Walsh, Ted Barrett and Dana Bash contributed to this story.