The former "The Real Story" host filed a sexual harassment suit on Wednesday against Ailes, accusing him of firing her because she refused to have sex with him.

Her contract with the network ended on June 23, 2016, because she refused Ailes’ “sexual advances and complained about severe and pervasive sexual harassment,” her complaint says.

Carlson says in the complaint that Ailes repeatedly made comments about her appearance, asked her privately “to turn around so he could view her posterior” and made other sexual advances. According to the complaint, at a meeting between Carlson and Ailes in September 2015, Ailes told Carlson, “I think you and I should have had a sexual relationship a long time ago and then you’d be good and better and I’d be good and better.”

Carlson also accused Ailes of dismissing her reports of her former co-anchor Steve Doocy creating “a hostile work environment by regularly treating her in a sexist and condescending way, including by putting his hand on her and pulling down her arm to shush her during a live telecast.”

She said Ailes responded to her complaints “by calling her a ‘man hater’ and ‘killer,’ and telling her that she needed to learn to ‘get along with the boys,’” according to the complaint. Doocy was not named as a defendant in the suit.

The complaint says Ailes retaliated by assigning her fewer political interviews, removing her from regular appearances, reducing her pay even when she took on her new solo show and ultimately ending her employment with Fox.

“Carlson’s show consistently ranked number one among cable news programs in her time slot,” the complaint says. “This success shows that there was no legitimate business reason for terminating Ms. Carlson.”

Ailes fired back against Carlson's allegations, calling the suit "offensive" and "wholly without merit."

"This is a retaliatory suit for the network’s decision not to renew her contract, which was due to the fact that her disappointingly low ratings were dragging down the afternoon lineup," he said in a statement. "When Fox News did not commence any negotiations to renew her contract, Ms. Carlson became aware that her career with the network was likely over and conveniently began to pursue a lawsuit. Ironically, FOX News provided her with more on-air opportunities over her 11 year tenure than any other employer in the industry, for which she thanked me in her recent book. This defamatory lawsuit is not only offensive, it is wholly without merit and will be defended vigorously."

21st Century Fox, the parent company of Fox News, said in a statement, "The Company has seen the allegations against Mr. Ailes and Mr. Doocy. We take these matters seriously. While we have full confidence in Mr. Ailes and Mr. Doocy, who have served the company brilliantly for over two decades, we have commenced an internal review of the matter."

Carlson confirmed on Twitter Wednesday morning that she had left the network. She had been the host of the daytime program “The Real Story with Gretchen Carlson” since September 2013, and she previously co-hosted the morning show “Fox & Friends.”