WASHINGTON, March 9 — President Bush signed a bill today renewing the antiterrorism measure known as the USA Patriot Act at an upbeat White House ceremony that belied the bill's tortured history.
"The Patriot Act has accomplished exactly what it was designed to do," Mr. Bush said before an audience of lawmakers. "It has helped us detect terrorist cells, disrupt terrorist plots and save American lives."
The president's signature, affixed in a moment as he sat at a desk, marked a victory that did not come easily. Passage by the House and Senate followed months of bitter debate between the chambers and within them, and between lawmakers and the White House.
Congress's work on the Patriot Act was completed on Tuesday, when the House approved a package of amendments that the Senate had adopted only days before. The measure had been stalled for months in the Senate over a dispute that has attended the Patriot Act since its original passage shortly after the attacks of Sept. 11, 2001.
The dispute is over the proper balance between national security and civil liberty, and it was clear even today that the conflict, which was run through much of United States history, was not silenced by the president's pen.
The Patriot Act expanded government surveillance powers in ways that its supporters say makes it easier to track terrorists, but which its critics say infringes on privacy by allowing investigators access to information like medical and library records.
The act in its latest form cleared its final hurdles after negotiations that added some judicial supervision, prevented the F.B.I. from demanding the names of lawyers consulted by people who get secret government requests for information, and protected most libraries from such pressure to provide information.
"The Patriot Act has served America well, yet we cannot let the fact that America has not been attacked since Sept. 11 lull us into the illusion that the terrorist threat has disappeared," Mr. Bush said at the ceremony.
The continuing tension over the Patriot Act was reflected in the stances of two men from Wisconsin: Representative F. James Sensenbrenner Jr., the Republican who heads the House Judiciary Committee, and Senator Russell D. Feingold, a Democrat on the Senate Judiciary Committee.
Mr. Sensenbrenner, who has accused the bill's critics of "exaggeration and hyperbole," smiled at the signing ceremony. Mr. Feingold, the only senator to vote against the original act in 2001, stayed away and issued a statement.
"Today marks, sadly, a missed opportunity to protect both the national security needs of this country and the rights and freedoms of its citizens," Mr. Feingold said, vowing to press for further improvements in the law.