Bill O’Reilly’s reign as the top-rated host in cable news came to an abrupt and embarrassing end on Wednesday as Fox News forced him out after the disclosure of a series of sexual harassment allegations against him and an internal investigation that turned up even more.

Mr. O’Reilly and his employers came under intense pressure after an article by The New York Times on April 1 revealed how Fox News and its parent company, 21st Century Fox, had repeatedly stood by him even as he and the company reached settlements with five women who had complained about sexual harassment or other inappropriate behavior by him. The agreements totaled about $13 million.

Since then, more than 50 advertisers had abandoned his show, and women’s rights groups had called for him to be fired. Inside the company, women expressed outrage and questioned whether top executives were serious about maintaining a culture based on “trust and respect,” as they had promised last summer when another sexual harassment scandal led to the ouster of Roger E. Ailes as chairman of Fox News.