NEW YORK — Roger Ailes is out as chief executive at Fox News Channel, his career at the network he built from scratch and ran with an iron hand for nearly 20 years over with stunning swiftness following allegations that he forced out a former anchor after she spurned his sexual advances.

Network parent 21st Century Fox said that Rupert Murdoch, the company's executive chairman, would run Fox News and its sister Fox Business Network, which Ailes had also led, until a successor could be found.

Murdoch, 85, and 21st Century Fox did not address the widening scandal in the statement on the resignation but lauded Ailes for his contributions.

Ailes did not comment in the statement, and no details were given on a settlement agreement.

“I am personally committed to ensuring that Fox News remains a distinctive, powerful voice,” Murdoch said. “Our nation needs a robust Fox News to resonate from every corner of the country.”

Murdoch cut short a vacation to address Fox News employees Thursday in New York.

Details were not given on the settlement agreement for a contract, which was supposed to run through 2018, but Ailes is expected to get a payment of at least $40 million.

Ailes will have no formal role in the company, but is expected to serve as an informal adviser to Murdoch, said a person familiar with the agreement who spoke on condition of anonymity because it is a personnel matter.

Fox is heading into a general election campaign in its customary spot at the top of the ratings, but without the man who sets its editorial tone every day. The announcement came on the day Donald Trump accepted the GOP nomination for president.

Ailes, 76, built a network that both transformed the news business and changed the political conversation.

Fox News Channel provided a television home to conservatives who had felt left out of the media, and played a part in advancing a rough-and-tumble style of politics that left many concerned that it was impossible to get things done in government.

Ailes' downfall began with the July 6 filing of a lawsuit by Gretchen Carlson, who charged that he sabotaged her career because she refused his suggestions for sex and had complained about a pervasive atmosphere of sexual harassment at Fox.

Ailes has denied the charges, but 21st Century Fox hired a law firm to investigate.

Several staffers jumped to Ailes' defense, but notably not Megyn Kelly, one of Fox's top personalities. It was reported that Kelly was among other women who had told investigators about harassment — denied by Ailes — and that corporate heads Rupert Murdoch and his sons, James and Lachlan, determined that Ailes had to go.

The company has no plans to make results of its investigation public.

Within two weeks of the court filing, Carlson's lawyers also said more than 20 women had contacted the firm with stories of alleged harassment by Ailes either against themselves or someone they knew. Two came forward publicly.

Before the charges, Fox's success had insulated Ailes despite some previous scrapes with the Murdoch sons over whom he would report to. Fox News Channel is the parent company's single most important property, said Pivotal Research Group analyst Brian Wieser, with some estimates that it accounted for nearly a quarter of the company's profits.

Ailes was a prominent Republican media consultant who later ran CNBC before Murdoch asked him to create a cable news network to compete with CNN at the same time MSNBC was starting.

Ailes' slogans, “fair and balanced” and “we report, you decide,” appealed to an audience that believed mainstream outlets didn't live up to those promises.

“He was ahead of his time in recognizing that dividing, not uniting, an audience would be the key to commercial success in the 21st century cable news business,” said Matt Sienkiewicz, communications professor at Boston College.

Ailes blew apart the notion that public affairs programming should target a broad audience with civil debates, he said.

Ailes hired a combative broadcast journeyman in Bill O'Reilly and turned him into the star of an opinionated prime-time lineup. He directed news coverage and emphasized issues like the so-called war on Christmas or the Benghazi, Libya, investigation that otherwise got little attention.

Republican politicians considered Fox the first stop for reaching their intended audience, and they learned to talk tough.

“We're not going to be defensive about anything,” Ailes said at the network's launch.

“It is always difficult to create a channel or a publication from the ground up and against seemingly entrenched monopolies,” Murdoch said Thursday. “(Ailes') grasp of policy and his ability to make profoundly important issues accessible to a broader audience stand in stark contrast to the self-serving elitism that characterizes far too much of the media.”

He was also a showman.

Fox had flashier graphics, brighter colors and a vitality its staid rivals lacked.

The daytime show “Outnumbered” is a classic Ailes concept: four women in dresses, their legs prominently displayed, debating issues with a single male panelist.

In 2011, Ailes told The Associated Press that he hired Sarah Palin as an analyst “because she was hot and got ratings.”

Ailes demanded and usually received loyalty from a team that knew there could be hell to pay otherwise.

When Paula Zahn left Fox for a job at CNN, Ailes retaliated by saying that a dead raccoon could have done her show and gotten the same ratings.

Critics scoffed at Ailes' promise that he'd lift Fox to first place. By 2002, he did, and Fox hasn't looked back.