MPs have passed controversial data collection laws after angry exchanges during an extended sitting of the House of Commons.

A group of up to 56 MPs stood against the massed ranks of the three main parties after their leaders agreed new legislation was urgently needed.

The Data Retention and Investigatory Powers Bill was agreed at third reading by an overwhelming majority of 416, after MPs voted 449 to 33 in favour.

The laws will mean internet firms and other companies will be required to store data on "who contacted whom and when" for 12 months.

The security services could listen to phone calls or read emails, although they would need to request a warrant, which would have to be signed off by a secretary of state, to do so.

The House of Lords will look at the Bill next as ministers aim to have it sent for Royal Assent before the end of the week.

Backbenchers across the Commons complained at the prospect of the Bill being forced through in a day.

Labour's Tom Watson said: "Parliament has been insulted... (This is) democratic banditry resonant of a rogue state."

Former Tory shadow home secretary David Davis said: "My understanding is there was an argument inside Government between the two halves of the Coalition and that argument has gone on for three months, so what the Coalition cannot decide in three months this House has to decide in one day."

Home Secretary Theresa May said the Bill was vital for national security and public safety in the wake of a European Court of Justice Ruling in April.

The Government has insisted the ruling throws into doubt existing regulations, meaning communications companies could begin deleting vital data.

Ministers claim the Bill only reinforces the status quo and does not create new powers.

Mrs May warned: "If we delay we face the appalling prospect police operations will go dark, that trails will go cold, that terrorist plots will go undetected.

"If that happens, innocent lives may be lost."