Theresa May has been accused, by a former director of public prosecutions, of an "extremely ugly and unhelpful" attempt to implicate opponents of David Miranda's detention in condoning terrorism.

Lord Macdonald criticised the home secretary after the Home Office said people who opposed the decision of the Metropolitan police to detain Miranda at Heathrow needed to "think about what they are condoning".

The former DPP told The World at One on Radio 4: "That is a rather ugly argument. To suggest that people who are concerned about the use of a power of this sort against journalists are condoning terrorism, which seems to be the implication of that remark, is an extremely ugly and unhelpful sentiment.

"People who are concerned about these issues are not condoning terrorism. They are asking a perfectly legitimate question, which is: are we striking the balance in the right place between security and liberty?"

He added: "Let's wait and see what the independent review of this episode has to say before we start accusing people of condoning terrorism and nonsense of that sort."

The intervention by Macdonald, a Liberal Democrat peer, highlights growing tensions within the coalition over the nine-hour detention of Miranda, the partner of the Guardian journalist Glenn Greenwald who has run a series of stories on the basis of secret NSA documents leaked by the whistleblower Edward Snowden.

The Guardian reported on Thursday that Nick Clegg is heading for a confrontation with the home secretary over the future of schedule 7 of the Terrorism Act of 2000, which was used to detain Miranda.

This allows police to detain individuals at ports and airports even if they have no grounds of suspicion.

May, who was informed in advance of the police action, has said she supported the detention of Miranda. But Clegg, who has made clear he was not given advance notice of the detention, is reserving judgment until David Anderson, the independent reviewer of anti-terrorism legislation, delivers his findings on Miranda.

The Lib Dems have also said they will look with "great interest" at a suggestion by Anderson that parliament should reassess whether police should be allowed to detain individuals if they have no suspicions about their activity.

Macdonald said the government should follow the example of the changes made to stop and search powers outside ports and airports.

On the basis of a recommendation by Macdonald, the government ended the right of police to stop and search people without reasonable suspicion.

He told Radio 4: "Schedule 7 allows the police to carry out searches at airports without reasonable suspicion, without any suspicion at all.

"They can just do it … we should be looking very closely at the use of schedule 7 powers – the ability of border policemen and policemen at airports to search without any suspicion at all people passing through airports.

"At the moment we allow officers to do that [to search people at ports and airports] even if they have no suspicion at all that anyone is guilty or may be guilty of anything.

"That is problematic particularly when the power is so very widely used."

The Home Office statement which angered Macdonald was issued on Tuesday. A Home Office spokesman said: "The government and the police have a duty to protect the public and our national security. If the police believe that an individual is in possession of highly sensitive stolen information that would help terrorism, then they should act and the law provides them with a framework to do that.

"Those who oppose this sort of action need to think about what they are condoning. This is an ongoing police inquiry so will not comment on the specifics."