Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

The House on Wednesday easily approved a measure that would end the National Security Agency’s bulk collection of phone records and replace it with a system that would search phone date on a case-by-case basis.

The legislation, which passed by a 338-to-88 vote, faces an uncertain future in the Senate where opposition to the bill stems from concerns it would weaken the government’s ability to thwart terror plots.

Congress must act before the section of the Patriot Act that authorizes the collection of telephone records expires on June 1.

House Speaker John Boehner, R-Ohio, said the legislation “strengthens our ability to deter and prevent attacks on U.S. soil by allowing authorities to monitor terrorists who enter the United States, and increasing penalties for those who support them. And it ensures Americans' civil liberties are protected.”

— Andrew Rafferty and Alex Moe