Image copyright Reuters Image caption Snowden's revelations sparked huge debate and protests

The US House of Representatives has voted to end the National Security Agency's bulk collection of Americans' phone records.

A 338-to-88 overwhelming vote in favour of the USA Freedom Act, already backed by the White House, means Senate backing would make it law.

The bill would empower the agency to search data held by telephone companies on a case-by-case basis.

Bulk collection was revealed in 2013 by ex-security contractor Edward Snowden.

Supporters of the Freedom Act, including privacy and civil rights advocates, say it protects privacy while preserving national security powers.

The bill, which only affects people within the US, would amend sections of the USA Patriot Act, which was passed after the 9/11 attacks and which will expire on 1 June.

The amendments would ban the agency's mass collection of telephone data - phone numbers, time and duration of calls - as well as emails and web addresses.

Image copyright Reuters Image caption An NSA data gathering facility in Utah

"Americans' liberty and America's security can co-exist," said House Judiciary Committee chairman Bob Goodlatte, who voted in favour of the bill.

"These fundamental concepts are not mutually exclusive."

Earlier this month, a US appeals court ruled that bulk collection of phone records by the National Security Agency was illegal.