Representative Mike Pompeo (R-KS) on Wednesday defended the National Security Agency's domestic surveillance program, saying it complied with U.S. law.

"I want to make clear to everyone that contrary to the suggestions of some, the NSA has not been acting outside the scope of its authorities," he said on the House floor. "The metadata program is carefully designed with program layers of oversight by all three branches of government. This is precisely the way our government ought to operate: with input from Article I and Article 2 and Article III of the United States Constitution."

Michigan Reps. Justin Amash (R) and John Conyers (D) had offered an amendment to the annual defense spending bill that would have prohibited the NSA from collecting data that does not pertain to a person under investigation. The NSA's domestic surveillance program has collected phone traffic data from nearly every American, including who they talked to, when and for how long.

Pompeo offered his own amendment as an alternative. His proposal restated current law, clarifying that the NSA could not store the content of communications.

"It's of course our duty to ensure that the NSA stays within its legal bounds here in Congress and this amendment makes it perfectly clear for everyone to know and understand," Pompeo said. "We shouldn't mislead the American people into thinking that the NSA has been acting illegally. There is perhaps no program in the United States government that is as carefully monitored in overseeing as the programs this amendment attempts to clarify."

The Amash-Conyners amendment was defeated by a narrow 217-205 vote, while the Pompeo amendment was approved by a landslide 409-12 vote.

Watch video, uploaded to YouTube, below: