The House shot down in a surprisingly narrow, bipartisan vote a defunding of NSA surveillance activities offered by a maverick Tea Party GOP congressman and a veteran Democratic stalwart.

And though the Senate was occupied passing a student-loan interest rate compromise Wednesday afternoon, the significance of the pitched battle in the lower chamber was not lost on its members.

The amendment to the defense appropriations bill offered by Reps. Justin Amash (R-Mich.) and John Conyers (D-Mich.) failed 205-217 — a margin that one Democrat said put the White House on notice about the National Security Agency programs unveiled by contractor Edward Snowden.

“National security is of paramount importance, yet the NSA’s dragnet collection of Americans’ phone records violates innocent Americans’ privacy rights and should not continue as its exists today,” Sen. Mark Udall (D-Colo.) said after the vote.

“The U.S. House of Representatives’ bipartisan vote today proposal should be a wake-up call for the White House,” Udall added. “I am urging the president and the NSA to join this growing bipartisan coalition and work with Congress to focus the NSA’s surveillance efforts on terrorists and spies — not innocent Americans.”

The White House came out strongly against the Amash amendment last night, as did a coalition of former national security officials from the George W. Bush administration.

After the roll call, 94 Republicans and 111 Democrats voted with Amash, while 134 GOPs and 83 Dems voted against the amendment. The “yeas” included alliances as diverse as Reps. Trey Gowdy (R-S.C.) and Maxine Waters (D-Calif.). The “no” votes included Speaker John Boehner (R-Ohio) and Minority Leader Nancy Pelosi (D-Calif.).

House Intelligence Committee Chairman Mike Rogers (R-Mich.) was among the committee leaders circulating a “dear colleague” letter warning that a vote for the amendment would gut national security.

After the vote, Rogers took a victory lap with Ranking Member Dutch Ruppersberger (D-Md.).

“The program addressed gaps in the nation’s ability to track terrorists planning attacks in the United States. Over the years, it has proven effective in identifying and disrupting multiple terrorist threats and saving countless American lives. The charge that the program tramples on the privacy of citizens is simply wrong,” the pair said in a joint statement. “This program balances our duty to protect the privacy of our fellow Americans with the equal duty to protect the nation.”

“As the bill moves to conference with the Senate, we will work to foster stronger public confidence in the program’s privacy protections to ensure that we retain this important national security tool,” Rogers and Ruppersberger added.

The amendment debate took on shades of Sen. Rand Paul’s (R-Ky.) filibuster on drones, stealing the top spots on Twitter’s trending topics and bringing groups such as Anonymous to the side of the GOP lawmaker. One noticeable cheerleader was Guardian columnist Glenn Greenwald, who broke the Snowden story.

But whereas one Democrat stepped in to help Paul with his 13-hour filibuster, party lines came crashing down over the Amash amendment as lawmakers stepped to the pro and con microphones.

Amash and Conyers were joined on the amendment to block telephone metadata collection funding for the NSA by Reps. Jared Polis (D-Colo.), Tom Massie (R-Ky.) and Mick Mulvaney (R-S.C.).

“Our amendment would have ended the NSA’s overbroad collection of Americans’ information by limiting the FISA court’s collection of telephone records to only those records that pertain to a person who is actually the subject of an investigation. We should gather information about potential terrorists, but there is no reason that the NSA needs the personal information of our friends and neighbors who are not even under any investigation,” Polis said.

“The government’s overly broad collection of telephone meta-data began as part of the NSA’s warrantless wiretapping programs under the Patriot Act, which is one reason I have been a vocal opponent of the Patriot Act,” he added. “However, I believe that even many Americans who supported the Patriot Act never intended that it would allow for the indiscriminate collection of Americans’ telephone calls to their families, colleagues, and friends.”

One of those arguing on the floor for the amendment was Rep. Jim Sensenbrenner (R-Wis.), an author of the Patriot Act, who received applause after saying “the time has come to stop” heavy-handed domestic surveillance.

Conyers and Rep. Zoe Lofgren (D-Calif.) circulated a “dear colleague” letter to Democrats urging support for the amendment. Amash and other libertarian GOPs allied with civil-liberties Dems to force leadership to allow a vote.

“If we are going down the road of allowing the government to collect everything on us, then we will go down the road of also allowing the government to put cameras in our homes and to track us everywhere we go in the name of safety. We have a deep tradition of liberty in this country and we must follow the Constitution,” Amash said today on Fox Business.

“We absolutely live in a risky world, but it’s very important that we comply with the Constitution, because when we throw things like the Fourth Amendment out the window, we lose our freedoms. And we are trying to protect ourselves against people who are allegedly fighting us because they hate our freedoms,” he continued. “Well, in the process, we can’t lose our freedoms.”

In the end, the House overwhelmingly agreed to a gentler amendment from Rep. Mike Pompeo (R-Kansas) saying that the NSA is not allowed to use taxpayer funds to acquire and store the content of a U.S. individual’s phone calls or emails.

That amendment, which basically just reaffirms current law, passed 409-12 with unanimous Republican support.

The House then passed the $595 billion defense bill 315-109. The bill funds a pay raise for service members and includes an amendment prohibiting civilian Defense Department furloughs next year.

The appropriations legislation, which is under a veto threat from President Obama for including “the House Republican Budget framework,” now goes to the Senate. It’s unknown if Paul will bring a similar effort in the upper chamber, which would similarly cause fault lines within the parties up there.

Sen. Ron Wyden (D-Ore.), another fierce critic of the administration on civil liberties, said it was progress to see the surveillance debate “in public and on the floor of the Congress, rather than another closed hearing or backroom meeting.”

“Today’s vote shows that the reformers who are championing this viewpoint are continuing to gain momentum in the House and Senate,” Wyden said, congratulating Amash and Conyers for their effort. “I am confident that they will continue to advance the cause of surveillance reform in the House of Representatives, and I look forward to working with my colleagues to keep advancing it in the Senate.”

Rep. Adam Smith (D-Wash.), ranking member on the House Armed Services Committee, said after the vote that the intelligence reauthorizing bill “is the best place to address these issues to ensure we have both the right tools and the right protections for civil liberties.”

“Considering this subject on an appropriations bill prevents us from considering how best to amend the law to ensure we achieve both goals,” he said. ”That is why I opposed the Amash amendment.”

“This is not about how sincere the NSA people are at implementing this technique, it is not about how careful they are,” Rep. Joe Barton (R-Texas), co-chairman of the Privacy Caucus and a backer of the Amash amendment, said on the floor. “It is about whether they have the right to collect the data in the first place on every phone call, every American, every day.”