Lawyers for the partner of the Guardian journalist who exposed mass email surveillance have written to home secretary Theresa May and the head of the Metropolitan police warning them that they are set to take legal action over what they say amounted to his "unlawful" detention at Heathrow airport under anti-terror laws.

In their letter to May and Sir Bernard Hogan-Howe they warn they are seeking immediate undertakings for the return David Miranda's laptop and all other electronic equipment within seven days.

His lawyers at the London firm Bindmans are seeking an official undertaking that there will be "no inspection, copying, disclosure, transfer, distribution or interference, in any way with our client's data".

But they say if there has already been an inspection of his laptop and other equipment it should not be disclosed to any third party, domestic or foreign and should be kept secure pending the outcome of the legal action.

Miranda, whose partner Glenn Greenwald has been working since May with the National Security Agency whistleblower Edward Snowden, was transiting in Heathrow airport en route from Berlin to Brazil on Sunday when he was detained under schedule 7 of the Terrorism Act 2000.

He was questioned for nine hours and according to the letter had belongings including his mobile phone, laptop, memory sticks, smart-watch, DVDs and games consoles confiscated.

The letter says the decision to detain Miranda "amounted to a frustration of the legislative policy and objects of the Terrorism Act 2000" and was for "an improper purpose and was therefore unlawful".

Bindmans say if the undertakings are not given by Tuesday afternoon they will have no option but to seek an urgent interim injunction in the high court.

The lawyers say they will also be seeking a "quashing order" confirming that his detention was "unlawful" and a mandatory order that all data seized is returned and copies destroyed.

"The decisions to use schedule 7 powers in our client's case amounted to a grave and manifestly disproportionate interference with the claimant's rights" under European human rights legislation, the letter adds.

Gwendolen Morgan, the lawyer at Bindmans dealing with the case, said: "We have grave concerns about the decision to use this draconian power to detain our client for nine hours on Sunday – for what appear to be highly questionable motives, which we will be asking the high court to consider. This act is likely to have a chilling effect on journalists worldwide and is emphatically not what parliament intended schedule 7 powers to be used for."

Bindmans say the police used the anti-terror laws in order to have "deliberately bypassed" the normal statutory procedures for seeking confidential journalistic material such as court orders under the Police and Criminal Evidence Act 1984.

Using Pace police can get permission to search premises and seize property but some classes of material are protected, including journalistic material.

"The decision was a flagrant misuse of the defendant's statutory powers," says the letter, which is signed by Bindmans.

The letter says Miranda was detained by police for almost nine hours in a secure area at Heathrow airport, adding that this was an unlawful "deprivation of liberty" under article 5 of the European Convention of Human Rights.

A Guardian News & Media spokesperson said: "David Miranda has filed a legal claim with regard to his detention at Heathrow airport on Sunday 18 August under schedule 7 of the Terrorism Act. The Guardian is supportive of that claim."