His forced resignation — and, later, the ouster of Fox News Channel’s biggest star, Bill O’Reilly — tarnished Ailes’s legacy and the network he’d built from scratch.

His 17-year-old son, Zachary, addressed that at a lunch following Ailes’s funeral Saturday. Zachary Ailes spoke of his father’s detractors — including the more than 20 women who accused Ailes of soliciting sexual favors in exchange for career advancement.

AD

“I want all the people who betrayed my father to know that I’m coming after them — and hell is coming with me,” the teen told the guests at the luncheon, according to the conservative news site LifeZette.

AD

Ailes biographer Gabriel Sherman called the remarks “scary” — but an attorney for the late Fox News founder, Susan Estrich, said “no threat was made or intended” when his son made those remarks at the gathering.

“At the lunch after the funeral, guests were invited to share stories about Roger,” Estrich said. “Zac talked about two movies he and his father enjoyed: ‘Wyatt Earp’ and ‘Tombstone.’ A 17-year-old, distraught over the death of his father, quoted a line from a movie.”

AD

In “Tombstone,” Wyatt Earp (played by Kurt Russell) holds a shotgun and says he’s seeking revenge on the people who killed one brother and maimed another:

It’s a popular quote, and has even sparked a line of T-shirts.

The Palm Beach funeral was attended by numerous conservative media luminaries, including Rush Limbaugh and Sean Hannity. LifeZette’s founder and editor, Laura Ingraham, also attended.

AD

“I loved my father,” Zachary Ailes told LifeZette on Saturday. “He considered how much certain people hated him as a measure of success.”

Ailes died May 18, days after hitting his head during a bathroom fall. He’d built the Fox News empire from the ground up during President Bill Clinton’s administration to counter cable news outlets that he and media titan Rupert Murdoch believed tilted too far to the left.

AD

Ailes steered the channel to the top of the cable news ratings heap, becoming, as The Post reported, “a primary architect of the modern-day Republican Party and conservative movement.” After his death, Hannity tweeted that Ailes had “dramatically and forever changed the political and the media landscape single-handedly.”

But lawsuits and complaints against Ailes and O’Reilly detailed a woman-demeaning “locker-room culture” at Fox News. The news organization did not return messages seeking comment.

AD

Last July, Gretchen Carlson, who co-hosted Fox & Friends and, later, her own show on the network, filed a lawsuit saying Ailes had sabotaged her career because she wouldn’t sleep with him.

AD

According to Carlson’s lawsuit, Ailes told her: “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.”

Fox News Channel’s parent company, 21st Century Fox, ultimately settled with Carlson for $20 million, although Ailes denied wrongdoing. The suit opened a floodgate of accusations, and 25 other women came forward with similar accusations.

Through a spokesman, Nancy Erika Smith, the attorney for Carlson and several of Ailes’s other accusers, declined to comment for this story.

As The Post’s Manuel Roig-Franzia, Scott Higham, Paul Farhi and Krissah Thompson wrote in July:

AD

AD

Interviews with four of those women portray the 76-year-old television powerhouse as a man who could be routinely crude and inappropriate, ogling young women, commenting about their breasts and legs, and fostering a macho, insensitive culture. Three of the women were speaking about their allegations for the first time, including a 2002 Fox News intern who says Ailes grabbed her buttocks, and a Fox News employee who says Ailes touched her and tried to kiss her against her will at his office in 2004. … It became a locker room, towel-snapping environment. He would say things like, ‘She’s really got the goods’ and ‘look at the t — s on that one.’ ”

Fox News announced Ailes’s resignation on July 21. Several other top executives also lost their jobs.

Then, in April, O’Reilly was pushed out by Fox News, following a New York Times story that revealed that the network had settled five sexual harassment allegations brought by employees against him over 15 years.

To quiet his accusers, Fox News and O’Reilly handed them nearly $15 million.

The O’Reilly news was part of a tumultuous year for Fox that began with reports about Ailes’s unwanted workplace advances. Some of the accusers were stars who had their own shows and made headlines. Others just happened to work close to Ailes.

His assistant-turned-accuser recounted to The Post a time Ailes sent her out to get a copy of the men’s magazine Maxim.

AD

“When I gave it to him, he said: ‘There are some great articles in here. And you’re pretty enough to be in here. You look like the women in here. You have great legs. If you sleep with me, you could be a model or a newscaster.’ ”

AD

The woman told The Post that she spurned Ailes’s advances, but said, “he persists. At first it was once a week. Then it got to be every day.”

After a few weeks, she told him she was quitting.

“When I told him I was leaving, he said he was sorry I was leaving and that he was really disappointed that I didn’t sleep with him,” she recalled. “He said, ‘You could have gotten anything you wanted.’ ”

“And then he grabbed me,” she said, “and grabbed my a–.”