Suspended Sun reporter Mazher Mahmood has failed in a bid to stop the BBC from publishing recent images of him.
But the Attorney General has issued a warning to the corporation that broadcasting a Panorama programme about Mahmood at this time could prejudice a potential future trial.
Mahmood has been suspended from the paper since July when the Tulisa Contostavlos drugs trial collapsed because the judge said Mahmood had lied in his evidence.
The BBC has agreed not to broadcast any images of Mahmood not already in the public domain until 6pm on Monday to give him time to lodge a challenge in the Court of Appeal if he wishes to.
Sir David Eady, who dealt with the injunction application, refused to accept an appeal to him.
Refusing the injunction, which would have covered any images taken since April 5 2006 not already in the public domain, the judge, Judge Eady, said the court had "no reason to restrict the corporation's freedom of speech or editorial discretion".
A letter from the Attorney General's office to BBC producer Meirion Jones was submitted in evidence.
It said: "The intention of the BBC to broadcast a Panorama programme on the activities of the reporter, Mazher Mahmood, has been drawn to the attention of the Attorney General by the solicitors acting for Mr Mahmood, Kingsley Napley. The Attorney General has asked me to write to you,.
"The Attorney General recognised that as Mr Mahmood has not been arrested, the provisions of the Contempt of Court Act 1981 do not apply. Neverthess, he asks you to consider whether it is in the public interest for the BBC to broadcast a programme at this time. The proposed broadcast may have the potential to prejudice any trial, should Mr Mahmood be charged."
Mahmood had applied for an injunction to prevent the BBC from broadcasting anything not in the public domain currently that could lead to his identification. His barrister, Adam Speker of 5RB, told the court it was not Mahmood's intention to prevent the broadcast altogether – "on their heads be it," said his lawyer.
Lawyer Manuel Barca, for the BBC, accused Mahmood of wanting to "preserve the shelf life of his livelihood" rather than his "identity", which he argued was not hidden from the public.
The BBC was accused of not putting forward a "genuine" public interest defence for why Panorama should be able to broadcast the programme. Speker also criticised the corporation for not disclosing to the court what means for identifying Mahmood it planned to broadcast.
"I'm not seeking to prevent the defendant from publishing any material which is in the public domain already," Speker said.
He argued that identification of Mahmood would lead to a threat to the safety of the journalist.
"It isn't sufficient for one to simply conclude that there is not reasonable expectation of privacy because he is a journalist," he said.
He told the court how Mahmood leads a "reclusive life", pointing to the fact he lives in "secure accommodation" with CCTV and a steel door. He added: "His neighbours do not know his real identity."
Speker also told the court that police had told him of a "serious and credible threat to his life being made in 2011" and that he had recieved "initimidating tweets" after the Tulisa trial.
He said that if Mahmood were to be further identified there would be a risk of "revenge attacks".
The judge said: "The central point of this application is danger to life."
Barca said: "What this is about is as we say protecting his livelihood…
"It is not identification that's in issue, it's appearance."
Barca also called into question Mahmood's High Court case against George Galloway in 2006 in which he attempted – and failed – to prevent the MP from publishing images of him on his website. He read out a statement from Mahmood's claim in which, according to Barca, he said: "I was not identifiable by them [the Galloway pictures] then and nor am I now."
Barca brought to the attention of the court Mahmood's book, Confessions of a Fake Sheikh, in which the journalist's identity is shielded only by thin black strips across his eyes.
Questioning whether Mahmood would do this if he felt further identifying himself would threaten the safety of him or his family, Barca said that someone who wanted to "hunt him down… could do a lot worse than take a copy of the claimant's book".
He also highlighted Mahmood's appearance on the Andrew Marr show in August 2008 when his appearance was concealed but his voice broadcast.
On 15 October this year, Barca said, Panorama wrote to Mahmood informing him of its impending documentary expose to give him the right to reply.
Barca told the court how Mahmood responded on 28 October with a contempt of court argument. He accused Mahmood of having "bolted on" his identification issue on to a later letter, sent on 31 October.
The BBC told the court how Mahmood cited Articles 2 (right to life), 3 (anti-torture and inhumane treatment) and 8 (right to respect for private and family life, home and correspondence) of the European Convention of Human Rights. He also cited the Data Protection Act, but Barca described that as a "fishing expedition".
Email pged@pressgazette.co.uk to point out mistakes, provide story tips or send in a letter for publication on our "Letters Page" blog