Doug Mastriano, a central figure in former President Donald J. Trump’s efforts to overturn the results of the 2020 election in Pennsylvania, won the state’s Republican primary for governor on Tuesday, making the general election a referendum on democracy in the place where American representative government was born.
The Associated Press declared Mr. Mastriano, a retired Army colonel and two-term state senator, the winner over a crowded field of Republican candidates. In the campaign’s final days, his opponents mounted an unsuccessful last-ditch effort to consolidate support around a rival, former Representative Lou Barletta.
In his short time in public office, Mr. Mastriano, 58, has emerged as Pennsylvania’s leading far-right figure.
He funded buses to shuttle supporters to the rally on Jan. 6, 2021, that preceded the attack on the Capitol. During his run for governor, he has barred the news media from attending his campaign events and has appeared with proponents of the QAnon conspiracy theory.
At the start of the coronavirus pandemic, Mr. Mastriano proposed a public registry of people who had tested positive for the virus, but he later campaigned against mask-wearing and vaccines.
On Saturday, after public and private polling showed Mr. Mastriano with a sizable lead over Mr. Barletta and the rest of the Republican field, Mr. Trump endorsed him, citing his fight to overturn the election.
“We’re going to win on May 17,” Mr. Mastriano said at a rally last week in Erie, Pa. “And to quote a friend of ours, it’s going to be huge.”
In Pennsylvania, the Republican primary for governor played second fiddle to the state’s Senate contest, into which far more money flowed. Only one of the candidates for governor, Bill McSwain, a former U.S. attorney, had enough money to air television advertising in the final weeks of the campaign.
Mr. Mastriano, Mr. Barletta and the others were left to grapple for limited attention from the news media.
Mr. Trump’s late endorsement of Mr. Mastriano infuriated some of the former president’s earliest supporters in Pennsylvania. Former Representative Tom Marino, who along with Mr. Barletta stumped across the state for Mr. Trump’s 2016 campaign, condemned the endorsement at an event for Mr. Barletta on Saturday.
“Where in the hell is the loyalty?” Mr. Marino said. “I am very disappointed in the president, the former president. Because apparently the loyalty does not go as far as he says his loyalty does.”
If Mr. Mastriano were to win the general election in November, he would have enormous power over how the 2024 presidential election is conducted in Pennsylvania. The governor appoints the secretary of state, who oversees the state’s elections. Mr. Mastriano has already said he would seek to decertify the 2020 results in the state.
Democrats nominated Josh Shapiro, Pennsylvania’s attorney general, who has planned a campaign for governor for years. Mr. Shapiro ran unopposed for the Democratic nomination.
In the final weeks before Tuesday’s primary, Mr. Shapiro’s campaign aired advertising across Pennsylvania saying “if Mastriano wins, it’s a win for what Donald Trump stands for,” a not-very-subtle attempt to lift his Mr. Mastriano’s financially struggling campaign among Republican primary voters. Officials in both parties in Pennsylvania believe Mr. Mastriano would be the weakest possible opponent against Mr. Shapiro in the general election.
Nick Corasaniti contributed reporting.