The US Congress has voted to temporarily extend an expiring law that governs how intelligence agencies can gather information from US telecoms companies.

While the Foreign Intelligence Surveillance Act (Fisa) went decades without controversy, the 1978 law in recent years has angered lawmakers of both parties over how it handles digital communications.

A part of the law known as Section 702 gives the National Security Agency (NSA) authority to ​spy on foreigners using data drawn from US digital infrastructure. Critics say the section allows the NSA and agencies it works with, such as the FBI, to mine massive amounts of individuals' information without a warrant.

The US House of Representatives and Senate each voted on Friday to extend the law for 10 days, after failing to secure a long-term authorisation - or "clean extension" - that President Donald Trump has demanded.

The Foreign Intelligence Surveillance Act of 1978 (Fisa) regulates certain types of foreign intelligence collection and compels the assistance of US telecommunications companies.