Members of the US House of Representatives banded together in a cross-party vote to pass legislation that would curb electronic snooping.
The measure would bar the National Security Agency (NSA) from collecting Americans’ personal online information without a warrant.
It was added on Thursday night to a $570bn (¬£335bn) defence spending bill.
The move follows revelations the NSA mass harvested data on telephone calls and snooped on foreign leaders.
“The American people are sick of being spied on,” Congressman Thomas Massie, the amendment’s sponsor, said.
The amendment, added to the defence bill in a 293-123 vote on Thursday, also prohibits the NSA and CIA from accessing commercial technology products, which some politicians have described as a government “backdoor” for snooping.