WASHINGTON – Sen. Pat Toomey (R., Pa.) sided with Republican defense hawks Tuesday in voting against a bill that would curtail the federal government's collection of American phone records, taking a stand in a fight that created sharp divisions in his party.

Toomey's vote came after days of debate between Republicans who worried that domestic spying was an invasion of privacy and wanted reform and those who wanted to preserve the program unchanged, fearing that new restrictions would hamper counterterrorism investigations. The dispute led to delays that caused the temporary expiration of legal authority for some counterterrorism programs.

The bill, the USA Freedom Act, would renew most of that authority but end the government's bulk collection of Americans' phone data. Toomey joined Senate Majority Leader Mitch McConnell (R., Ky.) in saying that changing the phone program would weaken safeguards against terrorism -- and against Sen. Rand Paul (R., Ky.), who called for even tougher reform.

"I am deeply concerned that the USA Freedom act diminishes an important tool," Toomey said in a floor speech after his vote.

He had supported a GOP blockade to halt the bill two weeks ago. That delay, combined with Paul's procedural maneuvers this week, stalled the renewal of surveillance provisions until after their expiration date of 12:01 a.m. Monday.

Sens. Bob Casey (D., Pa.), Bob Menendez (D., N.J.) and Cory Booker (D., N.J.) joined nearly every Democrat in voting for the bill, which passed 67-32 and which President Obama plans to sign. The measure will extend the life of surveillance powers tied to some wiretaps and collection of business records related to terrorism investigations.

Most Senate Republicans opposed it but enough – 23 – broke with McConnell to help it pass. The bill had cleared the House with broad bipartisan support and leaders there urged its swift passage.

The issue, which burst into the national consciousness after leaks by former intelligence contractor Edward Snowden, reached a crisis point this week when time ran out on certain Patriot Act provisions on surveillance.

Toomey said the phone data collection, under Section 215 of the Patriot Act, has been mischaracterized by "rampant misinformation." The existing law, he said, struck the right balance between national security and civil liberties.

"There's nothing radical about section 215 or the Patriot Act," Toomey said. "It did not authorize the (National Security Agency) to conduct wiretaps or listen in on any phone conversations and that has never happened."

He said the NSA could only collect data such as phone numbers and call time and duration.

Others in both parties called for more transparency and less sweeping collection of information. They want the collection to be more targeted to cases tied to terrorism - and some opposed the law because they felt it didn't go far enough.

Obama praised the law as striking the right balance.

"After a needless delay and inexcusable lapse in important national security authorities, my administration will work expeditiously to ensure our national security professionals again have the full set of vital tools they need to continue protecting the country," he said in a news release. "Just as important, enactment of this legislation will strengthen civil liberty safeguards and provider greater public confidence in these programs."

You can follow Tamari on Twitter or email him at jtamari@phillynews.com.