Fox News has agreed to settle a former anchor's sexual harassment lawsuit against former Fox News CEO Roger Ailes for $20 million, both sides said Tuesday.

ADVERTISEMENT

As part of the settlement, the company gave Gretchen Carlson an unprecedented apology.

It is not known how much Ailes will pay personally as part of the settlement.

"21st Century Fox is pleased to announce that we have settled Gretchen Carlson’s lawsuit," the network announced in a statement, lauding Carlson for exhibiting "the highest standards of journalism and professionalism" and for developing a "loyal audience."

"We sincerely regret and apologize for the fact that Gretchen was not treated with the respect and dignity that she and all of our colleagues deserve," Fox added. "We know Gretchen will be successful in whatever endeavors she chooses in the future."

Carlson said in her own statement that she was "gratified" by the result.

"I'm ready to move on to the next chapter of my life in which I will redouble my efforts to empower women in the workplace. I want to thank all the brave women who came forward to tell their own stories and the many people across the country who embraced and supported me in their #StandWithGretchen. All women deserve a dignified and respectful workplace. "

Vanity Fair first reported the settlement Tuesday morning.

Carlson filed a sexual harassment lawsuit against Ailes about two months ago.

Ailes resigned amid an internal investigation two weeks after Carlson filed the suit.

He denied the allegations, calling them "false" and "retaliatory" for not renewing Carlson's contract in June.

Reports surfaced earlier this month that Carlson secretly recorded inappropriate statements made by Ailes.

She recorded conversations with Ailes for a least a year, according to New York Magazine, and captured "numerous incidents" of harassment.

Updated at 9:59 a.m.