Journalists who interviewed Shamima Begum will not be forced to hand over their notes to counter-terrorism investigators, as police look to build a potential prosecution of the young “Isis bride”.

UK authorities had applied for orders forcing the BBC, ITN, Sky News and the Times to hand over unused notes and footage from their interviews with Begum, one of the teenagers who ran away from east London to join Islamic State in 2015.

But on Wednesday, a judge ruled that the journalists could not be compelled to hand over the material, after joint legal opposition from ITN, Sky News and the Times. Gavin Millar QC successfully argued the order would deprive journalists of their neutrality and place them at risk by making them de facto actors of the state.

“Journalists are believed to be neutral observers and it is this neutrality of the press that affords them protection,” he said.

Judge Mark Dennis QC agreed, saying: “There is no doubt that the initial Times newspaper report was a commendable piece of investigative journalism and represents a significant public interest story which has opened up an important issue for public debate. Such journalistic investigation is to be encouraged, however, the work of investigative journalists in particular does rely upon trust, confidentiality, protection of journalistic material and sources, their perceived neutrality, and the co-operation of people who are prepared to place their trust in journalists.”

Dennis said that as Begum had spoken openly and knew her words would be published, the threat to journalistic freedom from such an order was not as great as compelling journalists to name a confidential source. But he added: “Nevertheless, the purported interference remains and has a wider potential impact for journalists and cannot be simply discounted in the face of competing public interest in pursuing the police investigation.”

Begum’s re-emergence in a Syrian internment camp at the start of this year caused a media sensation, with the Times’s Anthony Lloyd securing the first interview in which she revealed she had lost three children and wanted to return to the UK but did not regret running away to join Isis.

Begum subsequently had her British citizenship revoked by the then home secretary, Sajid Javid, which in effect left her stateless. Begum’s family is challenging the decision in the courts and the family’s lawyer has claimed her appeal against the citizenship decision is being delayed to allow the police to build a criminal case against her.

The Metropolitan police had attempted to gather additional information on Begum under a provision of the Terrorism Act, as the authorities attempt to work out how to treat Britons who went to fight for Isis but now want to return home.

The application was the clearest sign yet that they are considering a potential prosecution of Begum if she is allowed to return to the UK.

Last month, the police explained their decision to apply for an order, saying officers request material “if they believe that they may have information or evidence that could assist a criminal investigation”.

“We fully respect the media’s independence. The police will, when appropriate, seek a production order in situations where that material is not provided voluntarily. The decision to grant or deny the production order, quite properly, lies with the court,” the force said.