Sir Cliff denied the allegation and the case was later dropped without charges being brought.

Mr Justice Mann upheld Sir Cliff’s claim that the corporation had breached his privacy by reporting the fact that he was under investigation by police. He also upheld Sir Cliff’s claim that this was a data protection breach.

He described the BBC’s broadcast coverage of the August 2014 police raid, which used footage from a helicopter, as “somewhat sensationalist”.

Speaking outside court earlier today, Unsworth apologised “for the distress Sir Cliff has been through”, but she confirmed the BBC was looking at appealing the verdict.

In a statement, she said: “We have thought long and hard about how we covered this story. On reflection there are things we would have done differently, however the judge has ruled that the very naming of Sir Cliff was unlawful.

“So even had the BBC not used helicopter shots or ran the story with less prominence, the judge would still have found that the story was unlawful – despite ruling that what we broadcast about the search was accurate.”

She said the judgement created “new case law”, adding that it “represents a dramatic shift against press freedom and the long-standing ability of journalists to report on police investigations, which in some cases has led to further complainants coming forward”.

She said: “This impacts not just the BBC, but every media organisation. This isn’t just about reporting on individuals. It means police investigations, and searches of people’s homes, could go unreported and unscrutinised.

“It will make it harder to scrutinise the conduct of the police and we fear it will undermine the wider principle of the public’s right to know. It will put decision-making in the hands of the police.

“We don’t believe this is compatible with liberty and press freedoms; something that has been at the heart of this country for generations.

“For all of these reasons, there is a significant principle at stake…”

Unsworth also responded to questions about whether she and head of newsgathering Jonathan Munro would resign as a result of the ruling.

She told reporters: “It’s a very long judgement. We need to go away and absorb all the details. There are 200 pages there. We need to look at it and consider what lessons there are to learn.”

She added that all BBC journalists had “acted in good faith” in covering the story.

Society of Editors executive director Ian Murray said today’s ruling had “worrying consequences for press freedom and the public’s right to know”.

He said: “While the judge, Mr Justice Mann, made it plain that the court felt the BBC’s coverage of the police raid on Sir Cliff’s home was sensational, and the BBC have admitted they have lessons to learn and have apologised to the star for the distress he has been through, to go as far as to make it unlawful that anyone under investigation can be named is extreme.

“Certainly, such a major change in the law should be debated in Parliament and not come into force following one case involving a high-profile celebrity.

“In many situations the publishing of the name of someone under investigation has led to other witnesses and victims coming forward. We should also consider that the reverse is true.

“It is vital that the actions of the police should be kept under scrutiny in a free society and this change in the law will make that much harder.”