Gretchen Carlson, second from right, interviewed a dog trainer on "Fox & Friends" in 2011. (Henry S. Dziekan III/Getty Images)

This post has been updated with a statement from Roger Ailes.

Gretchen Carlson tweeted Wednesday morning that she is no longer at Fox News. She didn't say why. But there is an explosive backstory behind Carlson's departure — she is suing Fox News chief executive Roger Ailes for alleged sexual harassment.

In a lawsuit filed Wednesday in New Jersey Superior Court, Carlson alleges that Ailes fired her last month after she rebuffed his advances.

"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," Ailes allegedly told Carlson last fall.

Ailes issued a forceful denial Wednesday evening:

Gretchen Carlson’s allegations are false. 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. 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

Carlson's show, "The Real Story," beat its competitors on CNN and MSNBC in the 2 p.m. time slot during the second quarter, but its audience was among the smallest on Fox News.

Carlson's attorney, Nancy Erika Smith, did not respond to a request for comment.

Other female employees have claimed harassment at the top-rated cable channel.

In 2004, Bill O'Reilly settled a sexual harassment suit brought by his former producer, Andrea Mackris. Howard Kurtz — then at The Washington Post, now at Fox News — described the resolution of the case at the time.

The deal likely involves payment of millions of dollars to Mackris, since the two sides were discussing an offer of well over $2 million when negotiations broke down, say sources close to O'Reilly. Both parties agreed to keep the details confidential, according to the statement.

O'Reilly told viewers, in language cleared by the lawyers, that there was "no wrongdoing in the case whatsoever by anyone" — and appeared to dispute, without specifically doing so, some of the lurid details of what Mackris alleged were phone-sex conversations between them. "Please do not believe everything you hear and read," he said on "The O'Reilly Factor."

The top-rated cable news host has said he was humiliated by the suit, which charged that he spoke to Mackris about sexual fantasies, masturbation and vibrators while sometimes seeming to pleasure himself.

In 2005, the Equal Employment Opportunity Commission sued Fox News on behalf of Kim Weiler, alleging sexual harassment by Joe Chillemi, then a vice president of advertising. Fox settled the case for $225,000.

In 2010, the EEOC sued again, this time on behalf of reporter Catherine Herridge, who said she was a target of gender and age discrimination. Fox won that case. Herridge is still at the network.

Carlson, who won the Miss America pageant in 1989, wrote about other instances of sexual harassment in a memoir published last year.

Early on I went to New York to meet with a top television executive I was told could help me. He spent a lot of time with me that day. He called a bunch of shows for me while I was sitting in the office and said, “I’m here with this great young girl. You got to take a look at her. She has a lot of talent.” ...

Afterward we got into his car and he gave the driver the address of the friend I was staying with. We were  sitting in the backseat together when suddenly he threw himself on top of me and stuck his tongue down my throat. He was all over me, and I can still feel his mouth on my mouth. It makes me a little sick even now. I pulled away from him, desperate to get away. Luckily, we were close to where I was being dropped off. I jumped out of the car and slammed the door without a word, racing into my friend’s apartment building. ...

How could this happen?

But it did happen — and not only that night in New York. A few months later I was in Los Angeles meeting with a top public relations executive about how to parlay my Miss America experience into a news media career. He suggested we get some dinner. As I got into the passenger seat of his car, he suddenly put his hand on the back of my head and shoved my face into his crotch. Sickened, I yanked myself up and sat frozen, not knowing what to do. This was a very powerful man, and I felt powerless. Somehow I got through the dinner — I’m embarrassed to say I didn’t flee, although in that unfamiliar setting I’m not sure where I would have gone. But I spent sleepless nights wondering what I should do next.

Carlson also wrote about having a positive relationship with Ailes. "In person, Roger was razor-sharp and inscrutable, and we seemed to have a real connection," she wrote. "He saw something in me that he liked — what he called my 'killer instinct.' He once noted that I would stop at nothing to do the job. He got me. Over the years, I've come to value our time together. He encourages me to be myself, to relax and to not try so hard to look smart."

Read the full suit here: