Former Fox News host Bill O’Reilly secretly settled a sexual harassment allegation with a network contributor for a whopping $32 million — by far the largest of six similar agreements that eventually led to his firing, a report has revealed.

O’Reilly agreed to the settlement back in January with the right-wing network’s longtime legal analyst Lis Wiehl, who had worked with the outspoken host, The New York Times reported Saturday, adding that Fox renewed his contract in February with a hefty wage of $25 million per year, despite knowledge of the settlement.

In a brief interview on Saturday following publication of the story, O’Reilly refused to discuss details of the settlement with Wiehl, citing a confidentiality agreement, claiming that he agreed to the deal “to protect my children from the horror” of continuing adverse publicity.

According to the report, Wiehl alleged that O’Reilly had repeatedly harassed her, had engaged in “a nonconsensual sexual relationship” with her, and had sent homosexual pornography and other sexually explicit material to her, the paper said.

Demonstrators rally against Bill O’Reilly outside Fox News in April 2017. (File photo)

O’Reilly spokesman Mark Fabiani, however, released an affidavit on Saturday showing that, as part of the settlement deal, Wiehl stated, “We have since resolved all of our issues” and that she would “no longer make the allegations” contained in a draft complaint against O’Reilly that she had drawn up months before.

O’Reilly was sacked in April by Fox News’s parent company, 21st Century Fox, after the Times revealed that he had also settled with five former colleagues who had alleged harassment by him over a period of more than a decade.

However, neither Fox nor 21st Century acknowledged the settlement with Wiehl at the time O’Reilly was fired.

If the reported figure is accurate, the latest settlement exceeds all of the previous agreements between O’Reilly and his accusers. The five settlement deals reportedly amounted to $13 million, and included a 2004 payment by O’Reilly to a former Fox producer named Andrea Mackris for $9 million.

Fox re-signed O’Reilly about seven months after a sexual harassment scandal involving its chairman and co-founder, Roger Ailes, exploded in July of 2016.

At the time, the company had claimed to have adopted internal measures to root out and address complaints of employee harassment.