US intelligence agencies will be forced to stop the mass collection of American phone data after attempts to strike a deal extending their powers collapsed in the Senate.

Rand Paul, an American senator and outlying contestant for the US presidency, was able to block attempts to protect metadata collection by the National Security Agency, whose activities were exposed by the whistleblower Edward Snowden in 2013.

Such activities had been authorised by a clause in the Patriot Act passed shortly after the terrorist attacks on New York in 2001, which had also set an expiration date on the powers.

"Tonight we stopped the illegal NSA Bulk data collection. This is a victory no matter how you look at it," Paul said on Sunday in Washington DC.

"It might be short-lived, but I hope that it provides a road for a robust debate, which will strengthen our intelligence community, while also respecting our constitution."

The victory of Paul and his allies is likely to prove brief as the Freedom Act advanced through the Senate on the same day, which may hand back the powers to the intelligence agencies if it is passed.

The bill even has backing from the US president Barack Obama’s office, which condemned the expiration of the powers as "irresponsible", and called on the infamously adversarial Congress to put aside political motivations.

In a written statement it said: "On a matter as critical as our national security, individual senators must put aside their partisan motivations and act swiftly. The American people deserve nothing less."

The quarrel comes only shortly after a federal appeals court ruled that the bulk collection of metadata was not supported by the Patriot Act, which added pressure on Congress to pass new legislation on government snooping.

Many will likely interpret the events as a vindication on Snowden, who remains in Russia due to fears he will not be given a fair hearing if he returns to the US, where many politicians and military officials have branded him a criminal and a traitor.

The change in the law does not affect snooping on foreign nationals.