Eager to move on from a scandal that rocked the Fox News Channel, Rupert Murdoch's 21st Century Fox (FOXA) said on Tuesday it has settled with former anchor Gretchen Carlson over her sexual harassment lawsuit against Roger Ailes, the powerful longtime chief of the conservative news network who was forced out of the company in July.

The settlement, which will pay Carlson $20 million, according to a source, comes just two months after Carlson sent shock waves through political and media circles when she accused a man once viewed as omnipotent of repeatedly making sexual comments about her. In one conversation that New York magazine said this week Carlson secretly recorded, Ailes allegedly said, "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," adding that "sometimes problems are easier to solve" that way.

In an emailed statement, Fox heaped praise on Carlson's work at the network over the course of none years while taking extraordinary steps to apologize for Ailes' behavior.

"During her tenure at Fox News, Gretchen exhibited the highest standards of journalism and professionalism. She developed a loyal audience and was a daily source of information for many Americans. We are proud that she was part of the Fox News team," Fox said. "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."

The apology is another black eye for 21st Century Fox which was forced to admit in 2011 to repeatedly hacking the voice mails of politicians, celebrities, relatives of deceased British soldiers as well as a murdered schoolgirl. The tabloid News of the World, owned by Murdoch's News Corp (NWSA - Get Report) , was forced to close as a result of the scandal and the subsequent trial of the newspaper's top editors and executives.

The Carlson settlement serves as a loud and unconditional vindication of Carlson's original complaint which prompted immediate scorn from Ailes and the Fox network as well as some of her former colleagues who sought to discredit her and her allegations. Neil Cavuto, managing editor at both Fox News and sister channel Fox Business Network, called Carlson's lawsuit "sick" in a column written shortly after the lawsuit was filed in a New Jersey court.

The settlement was first reported by Vanity Fair.

Ailes' lawyers initially tried to get courts in New Jersey and New York to throw out the lawsuit and have the matter resolved internally by Fox, arguing that her contract forbade her from taking such disputes to court. But those efforts were thwarted by Carlson's attorneys, who had smartly filed the lawsuit against Ailes in New Jersey, where he owns a home, rather than against 21st Century Fox.

Carlson's case was further bolstered by numerous reports that other women who worked for Ailes had received similar harassment, making sex a quid pro quo for career advancement. New York said that two dozen women told lawyers from law firm Paul, Weiss, Rifkind, Wharton & Garrison, hired by Fox to investigate Carlson's charges, that they too had been subjected to sexual harassment.

In a statement, Carlson said she was pleased by the settlement and hoped that her actions would embolden other women to speak out against harassment in the workplace.

"I am gratified that 21st Century Fox took decisive action after I filed my complaint," Carlson said. "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. All women deserve a dignified and respectful workplace in which talent, hard work and loyalty are recognized, revered and rewarded."

The settlement also underscores the aim of Rupert Murdoch and his sons Lachlan and James to remove the Ailes sexual harassment scandal from the news cycle as quickly as possible. In a head-turning series of events, Ailes on July 19 was forced out of Fox News, which he had run for more than two decades with a heavy hand. Just hours later, Donald Trump, whom Ailes has vigorously supported, accepted the Republican Party's presidential nomination.

Ailes is now a Trump adviser.

Despite the settlement, the Ailes sexual harassment story may still have legs. 

Ailes has had hired Charles Harder of the Beverly Hills law firm Harder Mirell & Abrams, the same libel attorney who won a stunning $140 million lawsuit in March against Gawker Media that was filed by former pro wrestler Terry Bollea, better known as Hulk Hogan. Harder sent New York magazine a letter over the weekend on behalf of Ailes and his wife Elizabeth regarding the reporting of Gabriel Sherman, the journalist whose stories more than any other kept the pressure on the Murdochs to investigate Carlson's allegations.

Harder, New York said in an e-mailed statement, asked the magazine to preserve documents related to Sherman's reporting "for a possible defamation claim." Harder didn't specify objections to Sherman's stories, the magazine said, adding that Sherman's work had been "very carefully reported."

In the Hulk Hogan case, a Florida jury ruled that Gawker had invaded Bollea's privacy when it published.