WASHINGTON – Western New York lawmakers are taking a strong stand on the side of a National Security Agency program that collects Americans’ phone records for use in terrorism investigations, despite a swelling movement on both the left and right that views it as an unwarranted and unprecedented violation of civil liberties.

The four House members from Western New York – Democrats Brian Higgins and Louise M. Slaughter, and Republicans Chris Collins and Tom Reed – all voted late Wednesday against an amendment that would have barred the NSA from collecting the phone records of anyone who isn’t the target of an active investigation.

The amendment failed in a vote of 217 to 205, but the closeness of the margin – and the impassioned debate it generated – showed a deep divide over the counterterrorism program.

Supporters of the program said the who’s-dialing-whom collection of data is essential to finding the personal connections at the root of suspected terrorist plots.

“The amendment would have ended the collection of phone records, which is very, very important in helping to thwart terrorist attacks,” said Higgins, D-Buffalo, who cited the foiled 2009 attempt to bomb Times Square as one prominent example where the program identified would-be terrorists.

But that very program has created a strange-bedfellows alliance that pairs the likes of Tom Bauerle, WBEN radio’s conservative talk-show host, with progressives such as Charles Bowman, head of the Western New York Peace Center.

Bauerle blasted the NSA program during his show Thursday, criticizing Higgins and Collins for their votes. And in a reference to the Constitution’s ban on unreasonable searches and seizures, Bowman said: “We should all feel violated. If they are collecting the phone records of every American, they are violating every American’s rights, and the Fourth Amendment has no meaning.”

The debate over the NSA program has been building for weeks, ever since Edward J. Snowden, a onetime NSA contractor-turned-whistle-blower, leaked the program’s existence to the Guardian, a British newspaper, and the Washington Post.

The program has its roots in the USA Patriot Act, the law Congress passed and later renewed in hopes of beefing up the nation’s spying capability in the wake of the Sept. 11, 2001, terrorist attacks.

To hear supporters of the program tell it, those roots have grown up into a robust counterterrorism infrastructure that’s keeping America safe.

Collins, R-Clarence, said he supports the program based on what he has learned about it in briefings on how well it is working.

“It’s very clear to me that the data-gathering that has occurred of telephone numbers – without infringing or imposing on anyone’s personal freedom or privacy – has saved American lives,” Collins said.

Reed, R-Corning, agreed.

“While the concern for proper oversight and transparency is a legitimate one, a knee-jerk reaction that puts American lives in jeopardy is not the answer,” Reed said. “If Congress is going to abolish a proven program of protection, Congress should have a plan to replace the program to ensure national security.”

Opponents of the NSA program insist that it can be trimmed back without harming national security.

“This amendment will not stop the proper use of the Patriot Act and authorities to conduct terrorism and intelligence investigations,” Rep. John Conyers, D-Mich., one of the chief sponsors of the amendment, said on the House floor. “I’d never block that. All this amendment is intended to do is to curtail the ongoing dragnet collection and storage of the personal records of innocent Americans.”

Meanwhile, Conyers’ partner in introducing the amendment, Rep. Justin Amash, R-Mich., said the argument in defense of the NSA program was nothing more than rhetoric.

“Opponents of this amendment will use the same tactic that every government throughout history has used to justify its violation of rights: fear,” Amash said. “They’ll tell you that the government must violate the rights of the American people to protect us against those who hate our freedom.”

Higgins acknowledged that some changes may be appropriate for the program that calls for the collection of phone records, as well as the rest of the national security apparatus.

He said, though, that the proper place for that review is not during a brief debate on the House floor on an amendment to a defense spending bill.

“Program reforms certainly may be warranted, but I think they should be done within the context of the Intelligence Committee, where both classified and unclassified information can be taken into account to get this thing right,” said Higgins, ranking Democrat on the House subcommittee on Counterterrorism and Intelligence. “Doing it in a 20-minute debate is the wrong process toward perhaps the right end.”

Higgins stopped short of saying that Snowden, 30, who’s now in legal limbo in Russia while seeking political asylum, should be returned to the United States to stand trial on charges of violating the Espionage Act of 1917.

Collins, however, seemed ready to throw the book at Snowden.

“I think Edward Snowden committed treason against the U.S. and should be treated as such,” Collins said. “He should be pursued in every way possible and should be brought back to this country to face the consequences of what he did.”

Those consequences may well include making the NSA phone-records collection effort far less effective, Collins said. Knowing that such phone data is being collected, terrorists have probably already switched to using throwaway cellphones that would leave no trail for federal agents to trace, he said.

Yet the argument that the NSA program has worked in the past carries little weight with progressive activists such as Bowman, who said the vast resources devoted to such security measures should be shifted toward developing renewable energy sources and providing health care for all.

“We have to get over this paranoia” about future terrorist attacks, Bowman said. “The ‘war on terror’ has to end. The fear has to end.”

That sentiment appears to be increasingly common in the House, where Democrats backed the effort to curtail the NSA surveillance program in a 111-83 vote. Republicans, meanwhile, opposed the effort, with 134 voting against it and 94 in favor.

Higgins cited a growing weariness with post-9/11 security measures – such as intrusive airport screenings and intense security at federal buildings – as one of the hidden reasons why the vote on the amendment was surprisingly close. “I think there is a national security fatigue, and it’s understandable,” he said.

In addition, Collins said, many Republicans may have supported the amendment because the Internal Revenue Service targeting of tea party groups has made GOP lawmakers – always skeptical of big government – even more wary of any huge federal effort.