South Yorkshire Police have apologised to Sir Cliff Richard and agreed to pay him substantial damages after the singer sued following BBC reports naming him as a suspected sex offender, a High Court judge has been told.

Lawyers told Mr Justice Mann, at a hearing in London on Friday, that Sir Cliff and force bosses had settled their dispute.

The singer had taken legal action against the BBC, and South Yorkshire Police, over coverage of a raid at his apartment in Sunningdale, Berkshire, in August 2014.

He had said his right to respect for private life had been infringed and he wanted ''very substantial'' damages.

Sir Cliff and the BBC remain in dispute.

Detail of the terms of the settlement were given to Mr Justice Mann by a barrister heading Sir Cliff's legal team.

Justin Rushbrooke QC did not say how much South Yorkshire Police had agreed to pay.

Mr Justice Mann has heard that in late 2013 a man made an allegation to the Metropolitan Police, saying he had been sexually assaulted by Sir Cliff at Sheffield United's Bramall Lane football stadium when a child in 1985.

Metropolitan Police officers passed the allegation to South Yorkshire Police in July 2014.

Sir Cliff denied the allegation ''as soon as it was brought to his attention'' and in June 2016 prosecutors announced that he would face no charges.

South Yorkshire Police had already apologised ''wholeheartedly for the additional anxiety caused'' by the force's ''initial handling of the media interest'' in its investigation into the singer.

BBC editors have said they will "defend ourselves vigorously''.

A spokeswoman said the BBC had reported Sir Cliff's ''full denial of the allegations at every stage''.

Mr Rushbrooke told Mr Justice Mann that Sir Cliff had sued alleging misuse of private information, infringement of his human right to respect for private life and a breach of data protection legislation.

He said South Yorkshire Police should not have made disclosures about the investigation into Sir Cliff to the BBC and should not have co-operated with the BBC in the way that they did.

He said their actions had facilitated BBC coverage which had been "shocking, humiliating and embarrassing" for Sir Cliff.

Mr Rushbrooke said the singer's reputation had been "forever tainted".

Barrister Adam Wolanski, who represented South Yorkshire Police, told the judge that force bosses accepted that Sir Cliff's private information should not have been disclosed to the BBC.

He said bosses acknowledged that the force's conduct had been unlawful and offered "sincere apologies" to Sir Cliff for the "distress and humiliation" he had suffered.