A journalist does not have to hand over her notes to the police, the High Court in Belfast has ruled.
The PSNI was trying to force Suzanne Breen to hand over material linked to articles she had written on the Real IRA.
Ms Breen, the northern editor of the Sunday Tribune, received the group's claim of responsibility for the murder of two soldiers in Antrim in March.
A judge ruled that to give up the material would endanger her life.
Ms Breen described it as a landmark ruling.
"I couldn't be happier with the decision," she said.
"Hopefully this will set a precedent. I hope no other journalist will find themselves hauled before the court."
She said she had been under immense stress over the past few months, but always had "great faith" in arguments put forward by her legal team.
His Honour Judge Tom Burgess, the Recorder of Belfast, accepted the argument that to give up the material would amount to a breach of Ms Breen's right to life under the European Convention on Human Rights.
He acknowledged that there was a great public interest in catching the killers but said the journalist's right to life outweighs that.
He said there was objective evidence that the terror group would target Ms Breen if the information was handed to the authorities, even as a result of a court order.
He rejected police argument that there was no immediate threat to the journalist, stating it was obvious that such a risk would only become real if the data was relinquished.
The judge described the Real IRA as a "ruthless and murderous group of people" who would have no hesitation in targeting the reporter.
The Recorder also said he was satisfied that the concept of confidentiality for journalists protecting their sources is recognised in law, and specifically under the Terrorism Act 2000 and Article 10 of the European Convention on Human Rights.
The National Union of Journalists has described the decision as "a victory for journalism and for civil liberties".
The union's General Secretary, Jeremy Dear, said: "The PSNI has failed on this occasion, despite tactics aimed at intimidating the media.
"We now hope that the security forces will concentrate on tracking down criminals and those responsible for murder rather than targeting journalists."