After a few days of negotiation, Mr. O’Reilly and Ms. Wiehl reached a deal, according to a copy of the term sheet for the agreement that was sent anonymously to The Times and confirmed by the people briefed on the settlement. Dated Jan. 7, it called for Ms. Wiehl to be paid over a period of time to ensure her silence. In return, she agreed not to sue Mr. O’Reilly, Fox News or 21st Century Fox. And all photos, text messages and other communications between the two would be destroyed. 
 
 Ms. Wiehl signed an affidavit, dated Jan. 17 and obtained by The Times, stating that the two sides had resolved their dispute and that she had “no claims against Bill O’Reilly concerning any of those emails or any of the allegations in the draft complaint.” In the affidavit, she said she had worked as a lawyer for Mr. O’Reilly and was serving in that capacity when he sent her “explicit emails that were sent to him.” 
 
 In response to questions about why he sent sexually explicit material to Ms. Wiehl, Mr. O’Reilly said that during his time at the network, he had been sent threatening messages almost every day, including some that had obscene material. To deal with this problem, Mr. O’Reilly said, he set up a system in which the material would be forwarded to his lawyers so they could evaluate whether he needed to take any legal action. Mr. O’Reilly said Ms. Wiehl was among those lawyers. 
 
 Although the matter had been settled confidentially, Mr. O’Reilly’s lawyers were concerned about keeping the dollar figure secret. Mr. Newman provided the company with a document that informed them of the deal but did not include the dollar figure. 
 
 The company said Mr. Newman made clear that it would not be told the financial terms because Mr. O’Reilly thought the company “leaked sensitive information.” 
 
 In February, Mr. O’Reilly received his new contract, with a salary increase to $25 million, from about $18 million. It’s not clear who initiated negotiations for the extension. Mr. Newman says Fox News pushed to renew the contract; the company says the negotiations were bilateral. 

 FILE - This Oct. 1, 2015 file photo shows Bill O'Reilly of the Fox News Channel program "The O'Reilly Factor" in New York. The Fox News Channel says the company knew a news analyst planned to file a sexual... (Associated Press) 
 
 FILE - This Oct. 1, 2015 file photo shows Bill O'Reilly of the Fox News Channel program "The O'Reilly Factor" in New York. The Fox News Channel says the company knew a news analyst planned to file a sexual harassment lawsuit against O'Reilly when it renewed the popular personality's contract in February... (Associated Press) 
 
 FILE - This Oct. 1, 2015 file photo shows Bill O'Reilly of the Fox News Channel program "The O'Reilly Factor" in New York. The Fox News Channel says the company knew a news analyst planned to file a sexual harassment lawsuit against O'Reilly when it renewed the popular personality's contract in February... (Associated Press) FILE - This Oct. 1, 2015 file photo shows Bill O'Reilly of the Fox News Channel program "The O'Reilly Factor" in New York. The Fox News Channel says the company knew a news analyst planned to file a sexual... (Associated Press) 
 
 NEW YORK (AP) — The parent company of the Fox News Channel says it knew a news analyst planned to file a sexual harassment lawsuit against Bill O'Reilly when it renewed the popular personality's contract in February. 
 
 The New York Times reported Saturday the company renewed O'Reilly's contract after he reached a $32 million settlement with the analyst, Lis Wiehl. 
 
 In a statement, 21st Century Fox defended its decision because it said O'Reilly had settled the matter personally. It also said O'Reilly and Wiehl had agreed the financial terms would be kept confidential. 
 
 The company says O'Reilly's new contract had added protections that allowed Fox to dismiss him if other allegations surfaced. 
 
 O'Reilly was ousted months later when it was revealed Fox had paid five women a total of $13 million to keep quiet about harassment allegations. 
 
 Mark Fabiani, a spokesman for O'Reilly, said in a statement Saturday that after 21st Century Fox fired founding CEO Roger Ailes in 2015 following harassment charges, dozens of women accused scores of male employees at Fox News Channel of harassment. The 77-year-old Ailes died in Palm Beach, Florida, last May. 
 
 21st Century Fox paid out close to $100 million dollars to settle all the cases, Fabiani said, adding that in O'Reilly's 20 years working at the channel not one complaint was filed against him by a co-worker, even on an anonymous hotline. 
 
 Wiehl's allegations included repeated harassment, a nonconsensual sexual relationship and the sending of gay pornography and other sexually explicit material to the woman, according to people briefed on the matter who spoke to The New York Times. 
 
 As part of the terms of their agreement, she signed an affidavit, dated Jan. 17 and obtained by the newspaper, stating that the two sides had resolved their dispute and that she had no claims against O'Reilly concerning any of the allegations in the draft complaint. All photos, text messages and other communications between the two would be destroyed, the newspaper reported. 
 
 The Associated Press emailed Wiehl on Saturday seeking comment. 
 
 The settlement was by far the largest of a half dozen deals made by O'Reilly or the company to settle harassment allegations against the host, according to the newspaper. 
 
 It was reached in January. A month later, 21st Century Fox granted O'Reilly a four-year extension on a $25 million-a-year contract. In April, it fired him. 
 
 Fabiani said the newspaper's account was false and taken out of context. The New York Times said it stands by its reporting. 
 
 "Mr Fabiani addresses everything but what the story actually says. This article, like our previous reporting on the subject, is accurate and deeply reported and we welcome any challenge to the facts," the newspaper said in a statement to The Associated Press on Saturday. 
 
 The most-watched figure in cable TV, O'Reilly has called his firing from the Fox News Channel a "political hit job" and that his network's parent company made a business decision to get rid of him. O'Reilly also has said his conscience was clear in how he dealt with women. 
 
 The company said it has taken numerous steps to change its workplace environment. 
 
 "21st Century Fox has taken concerted action to transform Fox News, including installing new leaders, overhauling management and on-air talent, expanding training, and increasing the channels through which employees can report harassment or discrimination," Fox said in a statement emailed to the AP. "These changes come from the top, with Lachlan and James Murdoch personally leading the effort to promote civility and respect on the job, while maintaining the company's long-held commitment to a diverse, inclusive and creative workplace." 
 
 O'Reilly hosts his "No Spin News" podcast on his website, www.billoreilly.com, contributes to Glenn Beck's radio program on TheBlaze and continues to write books in his best-selling series of historical "Killing" books, including his newest release, "Killing England: The Brutal Struggle for American Independence." 
 
 ____ 
 
 This story has been corrected to say Ailes died in Palm Beach, Florida, not Los Angeles.
– The parent company of the Fox News says it knew a news analyst planned to file a sexual harassment lawsuit against Bill O'Reilly when it renewed the popular personality's contract in February. The New York Times reported Saturday the company renewed O'Reilly's contract after he reached a $32 million settlement with the analyst, Lis Wiehl. In a statement, 21st Century Fox defended its decision because it said O'Reilly had settled the matter personally, reports the AP. It also said O'Reilly and Wiehl had agreed the financial terms would be kept confidential. The company says O'Reilly's new contract had added protections that allowed Fox to dismiss him if other allegations surfaced. O'Reilly was ousted months later when it was revealed Fox had paid five women a total of $13 million to keep quiet about harassment allegations. An O'Reilly rep said Saturday that after 21st Century Fox fired Roger Ailes in 2016 following harassment charges, dozens of women accused scores of male employees at Fox of harassment. 21st Century Fox paid out close to $100 million to settle all cases. Wiehl's allegations included repeated harassment, a nonconsensual sexual relationship, and the sending of gay pornography and other sexually explicit material, per people briefed on the matter. The settlement was by far the largest of a half-dozen deals made by O'Reilly or Fox. It was reached in January. A month later, Fox granted O'Reilly a four-year extension on a $25 million-a-year contract. In April, it fired him. O'Reilly's rep said the report was false and taken out of context. The Times stands by its reporting. "(The rep) addresses everything but what the story actually says. This article ... is accurate and deeply reported and we welcome any challenge to the facts," the Times said in a statement.