David Cameron has been drawn into the controversy over the treatment of David Miranda after Downing Street confirmed that the prime minister was given advance notice that police planned to detain the partner of Glenn Greenwald at Heathrow airport.

As the Home Office launched an aggressive offensive to justify the detention of Miranda, No 10 said the prime minister was informed of the planned police action.

A Downing Street source said: "We were kept abreast in the usual way. We do not direct police investigations."

The confirmation from Downing Street, which follows a statement from the White House that it was given a "heads-up" about the detention of Miranda, came shortly after the Home Office suggested that Greenwald's partner possessed "highly sensitive stolen information that would help terrorism".

A Home Office spokesperson 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."

The statement by the Home Office and the remarks by the No 10 source marked an abrupt change of tactics by the government, which had declined to answer questions about the detention of Miranda on the grounds that it was an operational police matter.

The government faced calls from across the political spectrum to give a more detailed response. Downing Street decided to clarify the position after Josh Earnest, the principal deputy White House press secretary, said at a briefing on Monday that the "British government" had decided to detain Miranda.

This claim was seized on by Yvette Cooper, the shadow home secretary, who demanded an explanation from her Tory opposite number, Theresa May.

No 10 sources said that the White House spokesman meant to say that the UK authorities, rather than the UK government, had made the decision to detain Miranda. The remarks by Earnest explained why No 10 felt the need to make clear that it did not direct police operations.

David Davis, the former shadow home secretary, dismissed the No 10 intervention. Davis told The World at One on Radio 4: "The simple fact that the White House had been notified about it really told you that the entire senior tier of government in this area would have known about it – the home secretary, probably the foreign secretary and almost certainly the prime minister.

"What that means is that of course they didn't direct it, nobody is suggesting they directed it. But they approved it by implication. If the home secretary is told this is going to happen and she doesn't intervene then she is approving it."

The statement from Downing Street came after Alan Rusbridger, the editor of the Guardian, confirmed that No 10 was involved in discussions to threaten the newspaper with legal action if it refused to destroy or hand over documents leaked by the US whistleblower Edward Snowden.

"We got the sense there was an active conversation within Whitehall and agencies and in Downing Street," Rusbridger told the BBC News Channel. Asked whether the matter went "right to No 10", Rusbridger said: "Yes."

The Guardian editor added: "It was quite explicit. We had to destroy it or give it back to them."

Miranda was stopped at Heathrow en route to Rio de Janeiro, where he lives with Greenwald, who has written a series of stories for the Guardian revealing mass surveillance programmes by the NSA.

He was returning to their home from Berlin when he was stopped at Heathrow under schedule 7 of the Terrorism Act 2000, allowing officials to take away his mobile phone, laptop, camera, memory sticks, DVDs and games consoles.

During his trip to Berlin, Miranda met Laura Poitras, the US film-maker who has been working with Greenwald and the Guardian. The Guardian paid for Miranda's flights. Miranda is not a Guardian employee but often assists Greenwald in his work.