Roger Ailes’ 20-year reign as the boss of cable TV’s No. 1 news outlet could soon be coming to an end as he negotiates his departure from Fox News Channel.

Ailes, 76 — who built Fox News into an influential, $3 billion business — is reportedly being shunted aside in the wake of a sexual harassment suit filed against him by former anchor Gretchen Carlson.

Ailes has strongly denied the accusation.

And while most FNC female staffers lined up to support Ailes, one did not: Megyn Kelly.

Kelly, a prime-time anchor, has remained publicly silent on the matter. On Tuesday, however, New York magazine reported that she told Fox lawyers conducting an internal probe that Ailes had sexually harassed her, too, in the mid-2000s, when she was a Washington correspondent. It was not clear what kind of harassment she alleged.

After the article emerged, several news outlets reported that negotiations on Ailes’ exit were under way. Late Tuesday, his lawyer, Susan Estrich, confirmed that the discussions were in the advanced stages, according to the New York Times.

She told CNN, “There’s lots of cross talk, but no agreement has been reached.”

FNC referred all calls to its parent, 21st Century Fox.

A departure by Ailes could bring chaos to the Fox News Channel.

Several of the network’s biggest stars — Bill O’Reilly, Sean Hannity and Greta Van Susteren — have clauses in their contracts that would allow them to leave if Ailes exits, according to a report in the Financial Times (paywall).

21st Century Fox maintained that “Roger is at work. The review is ongoing. And the only agreement that is in place is his existing employment agreement.”

While the terms or certainty of an Ailes exit may not yet have been reached — or may not be reached — a Drudge Report headline Tuesday afternoon blared that his departure would come with a $40 million golden parachute.

It would also contain a consulting contract through 2017, Drudge reported.

Ailes would be indemnified against any claims against him or the company, according to what is purportedly a copy of the separation agreement, dated July 22, that was posted on Drudge. It was quickly taken down.

Attorney Estrich told multiple news outlets that “Roger Ailes has never sexually harassed Megyn Kelly. In fact, he has spent much of the last decade promoting and helping her to achieve the stardom she earned, for which she has repeatedly and publicly thanked him.”

Ailes created FNC in 1996 and the channel initially had to pay cable TV systems to win carriage.

Within four years, though, Ailes’ hard work had transformed it into the No. 1 cable news network.

This year, aided by strong interest in the presidential election, FNC reported a 33 percent spike in prime-time ratings.

Gross advertising revenue for 2016 at FNC is pegged at $1 billion, according to SNL Kagan, which forecasts that FNC will also bag some $1.5 billion in revenue from affiliate fees. Overall net operating revenue will be $2.5 billion in 2016.

The cable network’s programming unit, which includes FNC, contributed operating income — before depreciation and amortization — of $4.64 billion for the year ended June 2015.

21st Century Fox, which shares common ownership with News Corp., parent of The Post, will report fourth-quarter and full fiscal-year results on Aug. 3.

With Ailes apparently headed to the exits, media circles were abuzz with the names of possible successors. The short list includes CBS News President David Rhodes, Fox News exec Bill Shine, viewed as the strong­est internal candidate, and Jay Wallace, the FNC executive VP of news and editorial.