Roger Ailes, who has died aged 77, was arguably the most important shaper of American politics of the past half-century. As a political kingmaker he was crucial to the election of four conservative presidents; as Ronald Reagan’s campaign manager Ed Rollins once said, “he was the premier guy in the business, he was our Michelangelo”. Ailes then used his political savvy to build the Fox News Channel into a kingmaking force, generating huge profits for Fox television and shifting the template of TV journalism.

The man who once told Richard Nixon, “This is not a press conference, it’s a television show,” set the stage for Donald Trump, who absorbed Ailes’ message and approached the presidential campaign as a reality programme. Fox was slow to get behind Trump, but when they did it was with full force. Yet after nearly three decades at the helm of Fox News, in July 2016, weeks before Trump was nominated as the Republican candidate for president, Ailes was forced to resign in the face of an avalanche of sexual harassment accusations from the network’s female stars.

Ailes entered politics after meeting Nixon in 1967, when the latter appeared on the syndicated Mike Douglas talk show in an attempt to burnish his image for a run at the Republican nomination in 1968. Ailes was the young executive producer, and before the show, when Nixon disparaged television as “a gimmick”, Ailes told him if he believed that he would lose the election. By the time they were finished, Nixon had hired Ailes as his media consultant.

Ailes knew, as the debates with John Kennedy in 1960 had shown, that Nixon was awful on television, so he orchestrated a campaign that relied on small staged live events, before carefully selected friendly audiences, and with pre-arranged questions asked by members of the crowd, not by the press. While his campaign scuttled the Paris peace talks to keep the Vietnam war an issue, Nixon followed a “southern strategy” of subtly coded appeals to the formerly Democratic states whose voters resented the civil rights movement. Resentment was an emotion that Ailes cultivated throughout his career, with politicians from Nixon to Sarah Palin playing to what Nixon called “the silent majority”.

That was the exact background into which Roger was born, in Warren, Ohio, to Robert Ailes, a maintenance foreman at General Motors’ Packard plant, and his wife Donna (nee Cunningham). Roger suffered from ill-health through much of his childhood, first as a haemophiliac, nearly dying when he bit his tongue, and then needing to relearn how to walk after being hit by a car.

His father threw him out of the family home when he left for Ohio University; Ailes reportedly returned to find his parents gone, having split up, and the house empty.

At college he managed the student radio station and graduated in 1962 with a degree in broadcasting. He got a job as a prop manager on the Douglas show, produced at the Westinghouse Broadcasting station in Cleveland. When the station, and programme, moved to Philadelphia three years later, he was its producer, and two years after that was made executive producer.

However, Ailes made the mistake of being too candid with the journalist Joe McGinniss and, in Nixon’s eyes, taking too much credit for his election in the now classic account of the 1968 campaign, The Selling of the President, published the following year. Nixon fired him, and Ailes went to New York to become a theatre producer. In partnership with Kermit Bloomgarden, he had a hit with Lanford Wilson’s play Hot L Baltimore. He also produced a documentary about Federico Fellini and a live TV special with Liberace from Caesars Palace in Las Vegas.

Nonetheless, he was drawn back to television, and took charge of Television News (TVN), a syndication service funded by far rightwing beer baron Joseph Coors to provide news items promulgating a conservative line that stations could use as if it were their own. Ailes was hired after most of the newsroom had refused to toe the ideological line and been fired. Although the project ended in failure in 1975, Ailes later appropriated the channel’s motto, “fair and balanced”, for Fox News.

After his return to political consulting, Ailes proved crucial when he was brought into Reagan’s campaign for re-election in 1984. His experience as a producer meant that Reagan would take instruction from him, and Ailes convinced him to rely on his image, as well as providing him with ripostes to questions or debating points, such as “quipping” that he would not use the age question against his younger opponent. “Forget facts and figures,” he said, “go on the offensive.”

He took this to an extreme in the 1988 election, when he chose George HW Bush to work with after other potential candidates had approached him. Ailes famously held the cue cards off-camera for Bush when he did a key interview with the CBS reporter Dan Rather, live but in a separate location.

Bush saw off Rather’s attempt to bring up the Iran-Contra scandal by turning the question around to Rather’s having walked off a set in a fit of pique a few weeks earlier.

Ailes also fine-tuned Lee Atwater’s infamous Willie Horton ad, aimed at Bush’s opponent, Michael Dukakis. Horton was a killer serving a life sentence when he committed robbery and rape while on weekend release from a prison in Massachusetts when Dukakis was governor. Ailes took Horton out of the ad, instead concentrating on a “revolving door” through which prisoners, one of whom looked like Horton, black with a large Afro, passed in and out.

In a book he wrote with Jon Kraushar, You Are the Message: Secrets of Master Communicators (1987), Ailes sought to convince readers that they, not the television, were actually making decisions. But an attempt to replay the Horton theme failed for Ailes in Rudy Giuliani’s 1989 attempt to unseat New York’s black mayor David Dinkins, after Dinkins branded Ailes a “master of mud”.

In 1991 Ailes announced his withdrawal from political consulting after his candidate, Richard Thornburgh, a former attorney general for Reagan and Bush, lost a race for the Senate in Pennsylvania. “I quit politics because I hated it,” he said, but like Nixon he was unable to keep his word to stay away. Instead he approached the business from the other side.

Facebook Twitter Pinterest Roger Ailes interviewed by Peter Robinson in 2010 in the Hoover Institution’s web series Uncommon Knowledge

While working for big tobacco to stop Bill Clinton’s healthcare reform, Ailes also began producing a syndicated TV show for the radio “shock-jock” Rush Limbaugh, which became a hit. He took over the failing CNBC business channel, tripled its profits and made stars of the combative host Chris Matthews and stunning business reporter Maria Bartiromo, setting a formula he followed at Fox: men apparently chosen for bombast and women for looks. But when a second channel he started for NBC, called America Talks, was taken from him and turned into MSNBC, Ailes left the network in 1996 and teamed up with Rupert Murdoch to launch Fox News.

If his on-air formula had been honed at MSNBC, it was perfected at Fox. Every programme, whether news bulletin, opinion or talk show, stayed on message, keeping to the same talking points, reinforcing them throughout the news cycle. Panels were weighted toward the in-house viewpoint; any token “liberal”, like Sean Hannity’s sparring partner Alan Colmes, was browbeaten, talked over and dismissed. Fox’s perceived antipathy towards black people, gay people or Muslims apparently echoed Ailes’ own attitudes, and he insisted on bullet-proof cars and office windows to protect him from angry minorities.

Fox’s impact reached its apotheosis with the 2000 election of George W Bush. It was Fox that first “called” Florida, and thus the election, for Bush. Ailes’ “decision desk”, which acted before any projections had indicated victory, was headed by John Prescott Ellis, Bush’s first cousin, whom Fox had hired after he left his job at the Boston Globe because he could not be impartial. Ailes later commented: “Fox would not be prejudiced in hiring just because of someone’s relations.” After Ellis’s call, the other networks panicked to follow suit. Bush was thus established as “the winner”, from whom victory would have to be stolen.

Ailes moved from strength to strength in the Bush years. Lachlan Murdoch left his position as head of Fox Television Stations in 2005, allegedly because his father Rupert sided with Ailes in a dispute, and Ailes took over. Fox News grew even stronger in opposition to Barack Obama. The subtle race card, first played on Nixon’s behalf in 1968, was played with less subtlety throughout two presidencies, and the slipshod Tea Party movement achieved respectability and power with Fox’s support. Defeated Republicans from Palin to Rick Santorum found profitable pulpits, and Fox became the unofficial home of the official opposition.

However, Ailes’ empire crumbled following a sexual harassment lawsuit brought last July by the news anchor Gretchen Carlson, a former Miss America who alleged she had been demoted when she complained about colleagues’ treatment of her. She proceeded to record Ailes’ conversations with her, full of sexual propositions offering rewards.

Gabriel Sherman, author of a 2014 biography of Ailes, The Loudest Voice in the Room, which had reported numerous incidents that Ailes had denied, produced six more women who backed up Carlson’s claims with more of their own. When Megyn Kelly, Fox’s biggest female star, was asked to go public to support Ailes, she refused, instead revealing that she too had suffered similar harassment. Although Ruper Murdoch allegedly wanted to wait until after the Republican convention, Lachlan and his brother James convinced him to get Ailes to go immediately, with a $40m payoff.

Ailes kept a low profile, but reportedly advised Trump behind the scenes during his presidential campaign. He died from bleeding on the brain after an accidental fall.

His first two marriages, to Marjorie White and Norma Ferrer, ended in divorce. In 1998 he married Elizabeth Tilson, who survives him, with their son, Zachary.

• Roger Eugene Ailes, television executive and political consultant, born 15 May 1940; died 18 May 2017