Bill O'Reilly was for years Fox News' most valuable on-air talent. He may also have been its loneliest.

The host, whose departure from the network was announced Wednesday, is widely disliked at Fox News and its parent company 21st Century Fox, both feared and loathed for his outsized ego and rude temperament, according to six current and former high-ranking sources at the company.

Even 21st Century Fox executive chairman Rupert Murdoch, who had until recently stood by O'Reilly amid recent revelations about sexual harassment allegations, does not have a close personal relationship with his star primetime host, several of these sources said.

Related: Bill O'Reilly out at Fox News

While O'Reilly's future at the network was determined by business calculations, sources said that his failure to establish relationships made him more vulnerable as Murdoch and his sons debated the host's future at the network.

Murdoch and his sons faced the decision about whether or not to get rid of O'Reilly due to the multiple accusations of sexual harassment and verbal abuse that have been directed at him over more than a decade. The New York Times reported earlier this month that O'Reilly, Fox and 21st Century had paid $13 million in settlements to five accusers.

The six sources who spoke to CNNMoney described O'Reilly as mean and self-centered, and said he was widely disliked at the company. They drew sharp contrasts between O'Reilly and his fellow primetime hosts Sean Hannity and Tucker Carlson, who they described as being as friendly in person despite being polarizing on camera.

Sources with knowledge of the matter say that Rupert Murdoch had been in favor of keeping O'Reilly because of his value to the company, and because he chafes at the thought of caving to public pressure.

Those same sources say that James Murdoch, the chief executive officer of 21st Century Fox, has been eager to get rid of O'Reilly in order to protect the company's reputation, and that Lachlan Murdoch, also an executive chairman of the company, had come around to his side by Tuesday.