The House has voted to continue the collection of hundreds of millions of Americans' phone records in the fight against terrorism.
The House rejected a measure to end the program's authority. The vote was 217-205 on Wednesday.
Republican Rep. Justin Amash had challenged the program as an indiscriminate collection of phone records. His measure, if approved by the full House and Senate and signed by the president, would have ended the program's statutory authority.
The White House, national security experts in Congress and the Republican establishment had lobbied hard against Amash's effort.
Libertarian-leaning conservatives and some liberal Democrats had backed Amash's effort.
The vote was unlikely to settle the fight pitting privacy rights against government efforts to thwart terrorism.