Three senior judges ruled today that some journalists can remain anonymous when giving evidence to the Leveson Inquiry into press standards.
They dismissed an action brought by the publisher of two newspapers.
Associated Newspapers, publisher of the Daily Mail and The Mail on Sunday, had said that its reputation could be unfairly tarnished by anonymous evidence which could not be fully tested or challenged.
Their challenge was against a ruling on the admissibility of anonymous evidence by inquiry chairman Lord Justice Leveson.
Lord Justice Toulson, Mr Justice Sweeney and Mrs Justice Sharp said in their ruling that it was not for the court to "micromanage the conduct" of the inquiry by its chairman.
In November, Lord Justice Leveson said he would be "prepared to receive anonymous evidence" after some journalists told him that they "feared for their employment" if what they said was attributed to them.
Associated Newspapers sought a judicial review of the ruling asking the judges to declare it unfair.
Lawyers representing Lord Justice Leveson, the National Union of Journalists (NUJ) and celebrities who have given evidence to the inquiry opposed Associated Newspapers' application.
Lord Justice Leveson said in his ruling: "The inquiry has been approached by a number of individuals, all of whom describe themselves as journalists working for a newspaper or newspapers either on a casual or full-time basis and who wish to provide evidence to the inquiry on the subject of the culture, practices and ethics of the press.
"Each has asked to provide this evidence anonymously and with such other protection that the newspaper or newspapers for which they work or have worked cannot identify them.
"It is clear that the picture which they wish to paint is not entirely consistent with the picture that editors and proprietors have painted of their papers and they fear for their employment if what they say can be attributed to them."
During the hearing of the application by Associated Newspapers, the three judges heard that around 20 journalists were due to give evidence later this month.
Mark Warby QC, for Associated Newspapers, questioned whether it would be fair to allow anonymous evidence which could not be fully tested or challenged.
He told the judges: "The concern is about untested evidence that will tend to tar Associated Newspapers with a broad brush."
In written arguments, he suggested that principles of fairness and open justice were at risk.
"The claimant objects to the decision in principle that certain witnesses should be anonymous, because they fear damage to their careers if they are named," he said.
"The essence of the challenge is that this is not a sufficiently weighty reason to outweigh the general principles of fairness and open justice."
He added: "Testing and rebuttal cannot take place when the evidence is given anonymously."
Robert Jay QC, for Lord Justice Leveson, said Associated Newspapers' application for judicial review was premature.
"On analysis, the chairman has determined in principle that his inquiry is prepared to receive anonymous evidence (as opposed to making a determination in principle that it would not)," said Mr Jay, in written arguments.
"The chairman has not determined whether such evidence should be received in any individual case: indeed, he has made it plain that before making such a determination the application would need to be accorded anxious scrutiny."
He said Lord Justice Leveson had to decide whether to hear evidence from a named witness or not hear the evidence at all.
"It is common ground that it is hugely preferable for the inquiry to take evidence from named witnesses than from anonymous ones," he added.
"However, the chairman is not making a choice between these two options - he has to choose between hearing this evidence from anonymous witnesses and not hearing it at all."
John Hendy QC, for the NUJ, said the journalists feared career prospects would be harmed if employers knew who they were.
Mr Hendy said it was in the public interest for such anonymous testimony to be allowed and told judges: "It is vital (Lord Justice Leveson) does have a balanced picture of what happens in newsrooms."
David Sherborne, who represents a number of high-profile figures involved in the inquiry, said it was of "the highest interest" to the public that as much evidence as possible was given about the "culture, ethics and practices" of the press.
He said: "If this evidence does not come out, this inquiry could be a waste of a lot of money."
Lord Justice Toulson, announcing his decision at the High Court in London, said the chairman had made a "positive decision in principle to receive anonymous evidence from journalists who wish to conceal their identity because of fear of career blight" - but that was a "general ruling".
He added: "When he comes to deal with individual applications for anonymity, he will scrutinise carefully what the witness says about his personal and professional circumstances and how far he thinks that the evidence will advance the purpose of the inquiry."
The judge said: "If the court ruled that the chairman could not lawfully admit evidence of the kind under consideration, and his report reflected that fact, the result would be that the inquiry would not have examined a raft of available evidence.
"There would be a cause for concern that in those circumstances the inquiry would have failed in a significant regard to achieve its terms of reference, and the credibility of its findings and recommendations would be lessened.
"It would be open to the criticism of not having heard the full story."
It had to be stressed that it was an inquiry and was not the same as a criminal trial or a disciplinary proceeding.
The judge said: "In determining where fairness lies in a public inquiry, there is always a balance to be struck.
"I am not persuaded that there is in principle something wrong in allowing a witness to give evidence anonymously through fear of career blight, rather than fear of something worse.
"Fear for a person's future livelihood can be a powerful gag.
"Nor am I persuaded that the chairman acted unfairly and therefore erred in law in deciding that on balance he should admit such evidence, subject to his considering it of sufficient relevance and being satisfied that the journalist would not give it otherwise than anonymously."
Lord Justice Toulson said: "The public interest in the chairman being able to pursue his terms of reference as widely and deeply as he considers necessary is of the utmost importance."
The issues being investigated by the inquiry affect the population as a whole.
He added: "I recognise that his ruling may cause damage to the claimant and other newspaper proprietors.
"However, such risk of damage will be mitigated to some extent (although not entirely, as I readily accept) by the fact that he will not use anonymous evidence to make specific findings against particular organisations.
"It is also important to recognise that the evidence in question will be part of a much wider tapestry and that it is open to the claimant and others to present balancing non-anonymous evidence."
He said: "I am not persuaded the chairman has reached an impermissible pre-judgment. He has reached a decision on a point of general principle and he has kept open more detailed scrutiny of individual cases."
How Lord Justice Leveson deals with individual anonymity requests "in the context of his general ruling and protocol" will be matters of "detailed consideration for him", which should not "forseeably give rise to further requests for judicial interference".