The BBC is paying damages to the ex-nanny to Princes William and Harry over false claims made about her to obtain a 1995 Princess Diana interview.
Alexandra Pettifer, known as Tiggy, was given an apology at the High Court over unfounded allegations she had an affair with Prince Charles and an abortion.
Her solicitor said the false claims had caused “serious personal consequences”.
A probe has already found Panorama’s Martin Bashir used fake documents to win Diana’s trust.
The BBC said it was “extremely sorry for the serious and prolonged harm” caused to Mrs Pettifer and her family.
In an agreed statement read out in court, Mrs Pettifer’s solicitor Louise Prince said the claims had included “the very serious and totally unfounded allegations that the claimant was having an affair with HRH Prince of Wales, resulting in a pregnancy which was aborted”.
“These allegations were fabricated.”
She said Mrs Pettifer had not known the source of the claims over the last 25 years, but it was “likely that these false and malicious allegations arose as a result and in the context of BBC Panorama’s efforts to procure an exclusive interview with Diana, Princess of Wales”.
Ms Prince said the former nanny was “relieved that the BBC accepts that the allegations are completely untrue and without any foundation whatsoever”.
The corporation will pay Mrs Pettifer a substantial, undisclosed sum and her legal costs.
As part of the statement, the BBC said it fully accepted the claims against Mrs Pettifer “were wholly baseless, should never have been made, and that the BBC did not, at the time, adequately investigate serious concerns” over how it had secured the Panorama interview.
It said that had it done so earlier, it could have corrected the false statements and “this may well have diminished the harm” caused to Mrs Pettifer and her family over many years.
Further details were read out in court about the false allegations of Mrs Pettifer having had an abortion.
The statement said that in October 1995, while BBC negotiations with Diana for her appearance on Panorama were at a critical stage, the princess relayed to her lawyer that she had been told Mrs Pettifer “had been operated on for an abortion” and that Diana would “shortly be in receipt of a certificate”.
But the High Court heard that Mrs Pettifer “did not have an affair with HRH The Prince of Wales, did not become pregnant with his child, and did not have an abortion”.
Following the hearing, BBC director-general Tim Davie said the corporation apologised to Mrs Pettifer, the Prince of Wales, and Princes William and Harry “for the way in which Princess Diana was deceived and the subsequent impact on all their lives”.
He added: “Now we know about the shocking way that the interview was obtained, I have decided that the BBC will never show the programme again; nor will we license it in whole or part to other broadcasters.”
Mrs Pettifer said she was disappointed “that it needed legal action for the BBC to recognise the serious harm I have been subject to”, in a statement reported by the Sunday Times.
She said she was “one of many people whose lives have been scarred by the deceitful way in which the BBC Panorama was made and the BBC’s subsequent failure to properly investigate the making of the programme”.
Mrs Pettifer went on to say the distress caused to the Royal Family was “a source of great upset to me”, adding: “I know first-hand how much they were affected at the time, and how the programme and the false narrative it created have haunted the family in the years since”.
“Especially because, still today, so much about the making of the programme is yet to be adequately explained.”
An inquiry last year led by retired judge Lord Dyson found the interview was obtained using fake documents and that the BBC fell short of “high standards of integrity and transparency”.
The report said Mr Bashir had lied repeatedly to several people, including at the BBC.
Mr Bashir, who received an industry award for the Diana programme and went on to work for ITV and in the United States, has previously apologised.
The journalist returned to BBC News in 2016 and became its religion editor – but no longer works for the corporation.