Roger Ailes, who became one of the most powerful figures in both U.S. politics and media by turning the Fox News network into a booming voice for conservatives before he was brought down by sexual harassment charges, has died at the age of 77.

Ailes worked as a media strategist for Republican Presidents Richard Nixon, Ronald Reagan and George H.W. Bush before launching Fox News in 1996.

His wife Elizabeth said in a statement on Thursday he was a patriot who was profoundly grateful for the opportunities his country gave him.

As founder, chairman and chief executive officer of Fox News, Ailes became one of the most influential figures in the Republican Party, and the network was integral to U.S. President Donald Trump’s successful run for the White House in 2016.

From the start, Ailes had a clear conservative vision of what he wanted Fox to be as he took the network to the top of the cable news ratings and made it a major profit center for Rupert Murdoch’s Twenty-First Century Fox Inc media empire.

But accusations of Ailes’ treatment of women would be his downfall.

In July 2016, Gretchen Carlson, a former Miss America who appeared on the popular “Fox and Friends” morning program before being given her own show, sued him. She said he had made sexual advances toward her and then hurt her career in retaliation after she rejected him.

Two weeks later, Ailes was ousted from the network with a $40 million severance package. His departure came during the Republican National Convention and at a time when the network was scoring record ratings. Shortly afterward, he began advising the Trump campaign.

Star cable host Bill O’Reilly himself left the network after he was accused of sexual harassment.

Ailes had run Fox News under the slogan “fair and balanced” and conservatives found it a much-needed antidote to the perceived liberal slant of traditional media. Critics denounced it as a cynical and polarizing right-wing propaganda machine.

“He helped market a brand of pseudo-journalism that revolves basically around hate, rhetoric, divisiveness, pitting people against each other,” Eric Boehlert, senior fellow at liberal media watchdog Media Matters for America, told Reuters. “That seeps into the culture and into politics.”

The story of Fox News was the story of Ailes. His conservative red-white-and-blue beliefs set the narrative for the network’s stories, and critics said it was difficult to determine where Ailes’ agenda ended and Republican Party talking points began. No potential Republican presidential candidate stood much of a chance without Ailes’ blessing.

“I want to elect the next president,” he told Fox executives at a 2010 meeting, according to the 2014 biography “The Loudest Voice in the Room” by Gabriel Sherman, a writer for New York magazine.

“Ailes’ power and ruthlessness … allowed him to take over the Republican Party and mold it to fit his paranoid world view,” Sherman told the Washington Post in 2016.

‘I WANT TO SEE HER LEGS’

In addition to its king-making power, Ailes wanted the Fox News network to be entertaining and have sex appeal.

“‘I want to see her legs,'” the source quoted Ailes as saying of an anchorwoman. “‘I want the viewers to see their legs. I want people to watch Fox News even if the sound is turned down.'”

Ailes built a reputation as intimidating, profane, egotistical, according to reports, and was so paranoid that Rolling Stone said he was convinced al Qaeda wanted to kill him. Sherman reported that Ailes spent millions of the network’s dollars to hire private investigators to follow unfriendly journalists, including him.

After Carlson’s lawsuit, other female employees, including Fox star Megyn Kelly, came forward to accuse Ailes of making inappropriate jokes, ogling them, commenting on their bodies, groping, kissing and propositioning them for sex in return for career advancement.

“It became common knowledge that women did not want to be alone with him,” the former Fox staffer told the L.A. Times. “They would bring other men with them when they had to meet him. It became a locker room, towel-snapping environment.”

‘INTIMIDATION, INDECENCY AND MISOGYNY’

A second suit was filed in August 2016 by Andrea Tantaros, another former Fox anchor who claimed that Ailes, who was married to former television executive Elizabeth Tilson, had also harassed her.

Behind the scenes, according to the lawsuit, Fox News was “a sex-fueled, Playboy Mansion-like cult, steeped in intimidation, indecency and misogyny.”

Ailes teamed up with Murdoch to put Fox News on the air on Oct. 7, 1996, and it gained traction with coverage of President Bill Clinton’s sex scandal involving White House intern Monica Lewinsky in 1998. By 2002 Fox had overtaken long-established CNN in the ratings.

As the network lashed Clinton and later Democratic President Barack Obama, flame-throwing commentators such as O’Reilly, Glenn Beck and Sean Hannity became household names. And when Republican politicians such as Newt Gingrich, John Kasich, Mike Huckabee and Sarah Palin were not in office, Ailes put them on the air as pundits.

O’Reilly left Fox News in April following his own sexual harassment scandal that had led to more than 50 advertisers pulling commercials from his program, “The O’Reilly Factor.”

Ailes was born in Warren, Ohio, on May 15, 1940. One of his first jobs after leaving Ohio University was a low-level position on “The Mike Douglas Show,” a daytime variety and talk show that initially aired in Cleveland.

He quickly worked his way up to executive producer and in 1967 had a life-changing conversation with Nixon, one of the show’s guests, and convinced the future president of the importance of television.

Nixon hired the 28-year-old Ailes to serve as executive producer for television on his successful presidential campaign a year later. Ailes was credited with crafting television events that let the candidate take his message directly to the public, rather than go through other media.

Ailes’ role was chronicled in the best-selling book “The Selling of the President 1968,” but after he described Nixon as “a funny-looking” guy who was seen as “a bore, a pain in the ass” he lost his White House job.

Ailes then worked in New York as consultant in both entertainment and politics, playing a role in successful campaigns by Reagan and Bush in the 1980s. He showed a special flair for attack ads.

Ailes married Tilson in 1998, and she became publisher of the Putnam County News & Recorder near their home outside New York City after he purchased the newspaper in 2008. They had one son.

(Writing and reporting by Bill Trott in Washington; Additional reporting by Lisa Richwine and Ginger Gibson; Editing by Diane Craft and Jeffrey Benkkoe)