PHILADELPHIA — Top Republicans are mounting a last-ditch, behind-the-scenes effort to stop state Sen. Doug Mastriano, a leading voice in the movement to overturn the 2020 election results, from winning the party nomination for governor in Pennsylvania.

With only days to go before the May 17 primary, GOP gubernatorial campaigns and leading state and county officials have been in discussions about uniting behind a single candidate to avoid a scenario in which Mastriano wins the crowded race by taking advantage of a splintered vote. If that doesn’t work, another option is persuading the candidates in single-digits in the polls to drop out.

Several gubernatorial campaigns have been involved in the talks, four GOP sources told POLITICO, in addition to Andy Reilly, a Republican National Committeeman, and Sam DeMarco, chair of the Allegheny County Republican Party.

DeMarco, the leader of one of the biggest county parties in the state and the chair of the Southwest caucus, confirmed that he is “a participant in those discussions.” On Tuesday, he tweeted out a poll showing Mastriano struggling against presumptive Democratic nominee Josh Shapiro, and announced that he is personally throwing his weight behind one of Mastriano’s top primary opponents, businessman Dave White, which he said is “of his own volition.”

“There’s so much that concerns me about this,” DeMarco told POLITICO, stressing that he was not speaking for the group. “We’re in a year where all evidence points to a red tsunami. And it appears here in Pennsylvania, because of the number of people in the race and his smaller but consistent base of support, we may be nominating the only Republican who would be unelectable in November.”

A spokesperson for Mastriano did not respond to repeated requests for comment.

The prospect that Mastriano — who was present at the Capitol during the Jan. 6 insurrection — could lead the GOP ticket has increasingly alarmed Republicans, both in Pennsylvania and nationally. (Mastriano has said he left before the riot took place.) They worry that the party could be dooming its chances in November by picking a polarizing candidate with limited appeal, who could also be a drag on the Republican ticket in what is otherwise shaping up as a favorable election year.

Reilly has talked with gubernatorial campaigns about conducting a poll to determine who is in second place behind Mastriano and asked if the candidates would unite behind that person, according to two people familiar with the conversations.

In a statement to POLITICO, Reilly said, “As National Committeeman, I have spoken regularly with almost all of the gubernatorial campaigns over the past [three] months. Last week when the presumptive [Democratic] nominee, Josh Shapiro, and the State Democratic Party used campaign resources to assist the candidacy of Doug Mastriano in the Republican primary, it raised concerns among the campaigns. Those concerns have led to discussions among the campaigns of which I have been occasionally involved.”

Shapiro, the state attorney general, started running a TV ad last week that could have been cut by Mastriano himself, save for the tagline at the very end. The spot throws red meat to MAGA primary voters, while also highlighting positions that Democrats hope would turn away general election voters. It was a sign that Democrats consider Mastriano as the weakest potential opponent in the fall.

Reilly added that since “the state party voted not to endorse a candidate, any decision a campaign makes to endorse another candidate, suspend their campaign or stay in the race is entirely the decision of that campaign.”

It is unclear whether the attempts by Republicans to coalesce behind someone other than Mastriano will be successful. Some in the party expressed skepticism that it would work, dismissing the effort as too little, too late. But others said it was possible it could lead to a candidate or two dropping out, making it potentially easier to defeat Mastriano.

“Bill McSwain is staying in the race,” said McSwain communications director Rachel Tripp. “He is fully committed to continuing on with his full slate of campaign activities and looks forward to victory on Tuesday.”

Mastriano has been the front-runner in recent polls.

Asked if Republicans are worried because of questions about Mastriano’s electability, Josh Novotney, a former campaign finance director for Sen. Pat Toomey (R-Pa.), said, “You can quote me on this one: Hell, yeah.”

“Everyone that I know has a concern about his electability,” continued Novotney, who has not been involved in the discussions about uniting behind a candidate. “I think if Josh Shapiro got to wave a wand and pick his opponent, he would definitely pick Mastriano.”

Mastriano himself has been mostly absent on the airwaves. Republicans have spent $22 million in total on television and radio advertising on the governor’s race so far, according to data from the ad-tracking firm AdImpact. Almost half of that money has been spent by former U.S. Attorney Bill McSwain’s campaign and a group that supports him, Commonwealth Leaders Fund.

Mastriano, however, accounts for less than $300,000 of that.

The Republican Governors Association also did not include Pennsylvania in its announcement of early media bookings across top battlegrounds. (There is no contribution limit in the state, so the committee could potentially rush the eventual nominee cash, who typically can buy ads at a lower rate.) The committee booked early general election airtime in Arizona, Kansas, Michigan, Nevada and Wisconsin in March — the first an open GOP-held seat and the latter four all with Democratic incumbents — and has already been spending to defend Georgia Gov. Brian Kemp, who is facing a primary challenge.

“I think there is a significant level of concern that Mastriano, of all of the primary candidates, will have the most difficult time in the general, just because of the level of his conservative viewpoints and policies,” said Mike Conallen, a Pennsylvania-based GOP strategist and former chief of staff to Rep. Brian Fitzpatrick (R-Pa.). “There was the general consensus that even though he was the most likely to win the primary, he was going to have the toughest time in the general.”

By contrast, Shapiro has had a glide path to the Democratic nomination. He did not face any primary opposition and has been amassing a formidable warchest for the general election in the perennial swing state.

Meanwhile, the GOP’s crowded, messy contest has been overshadowed at times by the party’s open Senate primary. Along with Mastriano, White and McSwain, a handful of other Republicans are among the top candidates vying for the nomination, including former Rep. Lou Barletta.

Jake Corman, the state Senate President Pro Tempore who feuded with Mastriano over control of a review of the 2020 election, filed to withdraw from the race in mid-April. But he abruptly reversed course the same day after he said he spoke to former President Donald Trump, who encouraged him to stay in the race.

Public polling has been infrequent, but a Fox News survey published on Tuesday evening showed Mastriano with a big lead in a crowded field. The poll placed him at 29 percent — an 11-point gain from the outlet’s poll in March — compared to 17 percent for Barletta, 13 percent for McSwain and 11 percent for White. Every other candidate was in the single digits.

In the days before Trump’s rally last week for Senate candidate Mehmet Oz, there was hope among some state Republicans that the former president would finally get involved in the governor’s race — and endorse a candidate other than Mastriano. When that didn’t happen Friday night, one Republican operative working on the gubernatorial election described “alarm bells going off” among the state GOP.

“I think folks were wishing [Mastriano’s rise] away for a long time and it’s become real. Everyone sort of hoped last week at the rally Trump would step in and he didn’t,” said the operative. “I got text messages from people waiting to see what he’d say and he didn’t mention the governor’s race at all. They said that’s one step below endorsing Mastriano because by not saying anything, you’re saying a lot.”

State Senate Majority Leader Kim Ward, who endorsed White, wrote about her concerns about the governor’s race in a Facebook post on Monday.

“The goal isn’t to win the primary. Winning the primary and losing the general because the candidate is unable to get the voters in the middle, isn’t a win. We need a candidate who can win in November,” Ward wrote.

Mastriano is among the most prominent far-right candidates running for statewide office this year. Besides his well-documented election denialism, he has ties to QAnon conspiracy theorists, recently appearing at an event called “Patriots Arise for God and Country.”

When Mastriano was asked about the appearance on a podcast for a local “center-right”-leaning outlet, he went on a tirade about the reporting in The Philadelphia Inquirer and attacked the podcast hosts.

“‘You were at a conference at Gettysburg with people I don’t like politically.’ Really? How stupid,” he said, demanding that the hosts prove the conference had a QAnon connection. He abruptly ended his interview after being asked about his claims that the election was stolen.

Still, Mastriano’s positions have won him a significant base of support among a fired-up group of Republican voters. And some wonder if he can be dislodged from the top of the field.

Republicans are largely on offense this cycle in gubernatorial races, with Democrats defending battleground states including Pennsylvania, Kansas, Nevada, Wisconsin and Michigan.

Shapiro’s ad appearing to boost Mastriano is an echo of Trump’s own rise through the Republican Party in 2016, when leading Democrats cheered the prospect of Trump’s candidacy, believing him to be the easiest person to beat in the general election.

“If Mastriano wins, it’s a win for what Donald Trump stands for,” the ad says, before adding a to-be-sure caveat of “is that what we want in Pennsylvania?”

“We had Josh Shapiro putting out an ad on me, condemning me because I’m very Trump-like. Thank you very much for that ad. This is going to be a huge red wave in November,” Mastriano told Steve Bannon on his show on Monday.

“The Josh Shapiro ad was the best pro-Mastriano ad of the campaign,” Bannon responded.

Meridith McGraw contributed to this report.