Fox News has decided to part ways with star host Bill O'Reilly following allegations of sexual harassment, the network said Wednesday in a statement.

"After a thorough and careful review of the allegations, the company and Bill O'Reilly have agreed that Bill O'Reilly will not be returning to the Fox News Channel," said the statement.

The decision, coming after advertisers had begun to flee his show, ends a more than 20-year career at Fox News for O'Reilly, a bestselling author as well as one of the most popular commentators on U.S. television.

In an internal memo to Fox News employees seen by Reuters, Rupert Murdoch called O'Reilly "one of the most accomplished TV personalities in the history of cable news."

Murdoch, who is executive chairman of Twenty-First Century Fox, also wrote the company is committed to "fostering a work environment built on the values of trust and respect."

O'Reilly, who has been off the air on vacation since April 11, said in a written statement he was proud of the "unprecedented success" at Fox.

"It is tremendously disheartening that we part ways due to completely unfounded claims, but that is the unfortunate reality many of us in the public eye must live with today," O'Reilly said in the statement, which was emailed by crisis communications expert Mark Fabiani.

FOX-OREILLY/

Demonstrators outside News Corporation headquarters in New York City called for O'Reilly's firing Tuesday, a day before the network severed ties with the host. (Mike Segar/Reuters)

O'Reilly will be replaced in his prime-time lineup by Fox host Tucker Carlson. Carlson's show had been moved earlier this year to replace The Kelly File with Megyn Kelly, another Fox News star who left the network this year.

Marc Kasowitz, O'Reilly's lawyer, said in a statement on Tuesday that the television host "has been subjected to a brutal campaign of character assassination that is unprecedented in post-McCarthyist America."

Most watched program

A Vatican photograph showed O'Reilly shaking hands with Pope Francis after a general audience on Wednesday, but it was not clear if the Pope knew who the television host was.

The New York Times reported on April 1 that Fox and O'Reilly, a 20-year veteran of the conservative cable network, paid five women a total of $13 million to settle harassment claims. The five women who received settlements either worked for O'Reilly or appeared as guests on his program, according to the New York Times story.

O'Reilly said in the statement at the time that he had settled only to spare his children from the controversy.

O'Reilly's show, The O'Reilly Factor, is the most watched program on Fox News and is coming off the highest-rated first quarter in its history, averaging four million viewers, according to Nielsen. Ad-tracking firm Kantar Media said the show brought in $147.13 million US in advertising revenue in 2016. 

Twenty-First Century Fox's last fiscal year, which ended June 30, 2016, brought in a total of $7.65 billion in advertising revenue.

But after the New York Times report, advertisers including BMW of North America, Allstate Corp, French pharmaceuticals maker Sanofi SA and T. Rowe Price , pulled their advertising from O'Reilly's prime-time show. 

TV-Fox News-The Latest

O'Reilly's departure follows that of former Fox News chairman Roger Ailes, right. Fox contributor Julie Roginsky, left, brought a lawsuit against Ailes. (Richard Drew, left, and Charles Sykes/Associated Press)

O'Reilly's exit follows that of former Fox News Chairman Roger Ailes, who was forced to resign in July after being accused of sexual misconduct by a number of women, including former anchor Gretchen Carlson. Ailes has repeatedly denied any wrongdoing.

Twenty-First Century Fox has tapped the law firm Paul, Weiss Rifkind, Wharton & Garrison, which also looked into the allegations against Ailes, to investigate O'Reilly's conduct.

Investors unruffled

Investors seemed to take the news in stride. Shares of Twenty-First Century Fox were down less than one per cent at $30.50 in Wednesday afternoon trading.

O'Reilly's departure will not have any effect on Twenty-First Century Fox's overall profitability, said Brian Wieser, an analyst at Pivotal Research.

Media mogul Rupert Murdoch and his son Lachlan are co-executive chairmen of the company and son James is chief executive officer.

"They could literally go dark during the time his program airs and they would still be profitable," said Wieser. 

A bigger issue for investors is what the Murdochs will do to prevent the company being in the headlines again just a few months from now, Wieser said. "That's bigger than O'Reilly," he said. "The cultural issue is a big issue."

With files from CBC News