Two MPs, Tom Watson and David Davis, are to sue the government for introducing “ridiculous” emergency legislation allowing police and security services access to people’s phone and internet records.

The MPs from either side of the House of Commons have applied for a judicial review of the Data Retention and Investigatory Powers Act (Drip).

This act of parliament was driven through the House of Commons with ridiculous and unnecessary haste to meet a completely artificial emergency. David Davis MP

Drip was rushed through parliament in just three days after receiving backing from all three major party leaders. It is a response to a European Court of Justice (ECJ) ruling in April, which essentially ruled that what’s happening in the UK – under the Data Retention Regulations Act of 2009 – was illegal.

David Davis, the former Home Secretary and Conservative MP for Haltemprice and Howden, said: “This act of parliament was driven through the House of Commons with ridiculous and unnecessary haste to meet a completely artificial emergency.

You cannot make good laws behind closed doors. Tom Watson MP

“As a result members of parliament had no opportunity to either research it, consider it or debate it properly and the aim of this legal action is to make the government give the House the opportunity to do what it should have been allowed in the first place. Proper, considered and effective law making.

“The overall aim is to create law which both protects the security of our citizens without unnecessarily invading their privacy.”

Tom Watson, Labour MP for West Bromwich East, said: “The three party leaders struck a private deal to railroad through a controversial bill in a week. You cannot make good laws behind closed doors.

“The new Data Retention and Investigatory Powers Act does not answer the concerns of many that the blanket retention of personal data is a breach of fundamental rights to privacy.”

This private cross party stitch-up, railroaded onto the statute book inside three days, is ripe for challenge in the courts. James Welch, Liberty

David Cameron insists the legislation is needed to prevent the risk of information on terror suspects being deleted – and says the new legislation does not expand on existing powers. However, critics have raised concerns that the act is an extension of powers.

Mr Davis and Mr Watson, backed by human rights charity Liberty, have written to the Home Office to give them seven days’ notice of their intention to apply for judicial review.

James Welch, Legal Director for Liberty, said: “It’s as ridiculous as it is offensive to introduce an ’emergency’ law in response to an essay crisis.

“The court ruling that blanket data retention breached the privacy of every man, woman and child in the UK was more than three months ago.

“The government has shown contempt for both the rule of law and parliamentary sovereignty, and this private cross party stitch-up, railroaded onto the statute book inside three days, is ripe for challenge in the courts.”

If successful, the case – which could be heard in the autumn or early next year – would not strike down the act but would require the government to take action to ensure it is compatible with human rights law.