The US House of Representatives has voted to end the NSA’s bulk collection of phone records that was revealed by the whistleblower Edward Snowden.

Under the USA Freedom Act passed with bipartisan support, the existing Patriot Act will be amended to stop spies collecting metadata of Americans’ phone calls, which includes information about who is being called, how long conversations last and how often such conversations take place.

However it still leaves open the possibility that American spies and police could request such data from private telecoms companies, which can hold records for up to five years.

Adam Schiff, a representative in California from the leftwing Democrat party, and member on the House intelligence committee, told the New York Times: "I think we have found an equilibrium on how to protect both security and privacy.

"These issues are not going away. I think the fact that the public is becoming much more united on how we balance these dual imperatives has ripened in a very constructive way."

Whilst the bill has passed through the lower house in Congress, it still has to make its way through the Senate, the upper house of the US Congress.

There it will face hostility from the senator Mitch McConnell, who leads a rightwing Republican majority and wants data collection to continue, as well as the Republican senator Rand Paul, who wants even more restrictions on snooping.

Speaking also the New York Times, Republican senator Ted Cruz said: "We have an obligation to protect the constitutional rights of every American.

"The USA Freedom Act ends the federal government’s bulk collection of phone metadata from millions of law-abiding citizens. That’s the right thing to do."