For months, Pennsylvania Republican insiders thought far-right state Sen. Doug Mastriano had little chance of winning their primary for governor.
One of his top five or six rivals would, at some point, coalesce the vote and leave his candidacy in the dust.
Then Mastriano began building out a lead in the polls - and kept building on it. Then former President Donald Trump endorsed him. And then he won.
Now, Republicans, some of whom are left regretting how the primary process played out, are looking ahead to the general election in November. They're determined to flip the governor's mansion, even though many view the party's new standard-bearer as way too out of step with the state's traditionally more moderate electorate to win, a dynamic Democrats are eager to exploit.
But Mastriano's defeat at the hands of Democratic nominee for governor, Josh Shapiro, the state attorney general, is anything but assured, especially in the current political environment where it appears Democrats may suffer a sweeping rebuke nationally. The race will have major implications not just for the future of the state, but for the nation as a whole, as the winner will have oversight of the 2024 presidential vote count in the critical swing state.
A former Army colonel whose winning campaign message wove together Christian nationalism, election denialism and a rejection of Covid mitigation policies, Mastriano pledged in his election night address that on the first day of his administration he would crack down on "critical race theory," a catchall term Republicans have used to target school equity programs and new ways of teaching about race, transgender rights and any remaining Covid vaccine requirements.
"CRT is over," Mastriano declared. "Only biological females can play on biological females' teams," he added, and "you can only use the bathroom that your biology and anatomy says."
David La Torre, a Republican and former adviser to fellow gubernatorial candidate Jake Corman, said he will not vote for Mastriano this fall.
"As far as what a Pennsylvania government would look like with Mastriano in charge, quite frankly, it's just not something I'm ready to think about at this point," La Torre said, adding that while there are many unknowns, the dynamic between Mastriano and the state Legislature, currently controlled by Republicans, would be one to watch.
"All I know is this - he will govern as governor like he campaigned," he said. "He would govern with a sledgehammer and expect Republicans to fall in line. And it would be one of the more fascinating tugs of war we've seen in Harrisburg."
Mastriano's campaign did not respond to a request for comment.
Mastriano, who won the primary by more than 23 points over former Rep. Lou Barletta and others, built his brand and loyal following by doggedly seeking to overturn President Joe Biden's win in the critical presidential battleground. He was outside the U.S. Capitol in Washington on Jan. 6, 2021, though he said he left before the riot. And he was subpoenaed by the House Jan. 6 committee over his efforts to send alternate electors to Congress, another effort to subvert Biden's victory. And he has campaigned at events alongside QAnon adherents.
Dave Ball, chairman of the Washington County GOP, told NBC News that Mastriano's victory was "a shame" for the party, the product of "a phenomenon that I truly don't understand." But any misgivings won't stop Ball from working toward the ultimate goal: taking back the governor's mansion, saying it's a must-win race. (The two-term incumbent, Tom Wolf, a Democrat, is term-limited.)
"And if we don't do that, we, as leaders of the party, have failed our constituents," Ball said of supporting GOP primary winners.
Gearing up for the fall, Mastriano will be running alongside state Rep. Carrie DelRosso, who won the GOP primary for lieutenant governor by 10 points, besting Teddy Daniels, Mastriano's hand-picked running mate, and others.
DelRosso comes from a different wing of the Pennsylvania GOP, having flipped a Democratic-controlled suburban state House seat near Pittsburgh in 2020. She's promoted mail-in and absentee voting in her victories, says she wants to work across the aisle with Democrats on economic issues, and has previously pushed back on the Jan. 6 riot, saying she was no fan of the law-breaking and violence that took place.
In an interview, DelRosso said she and Mastriano chatted over the phone immediately after their wins Tuesday, congratulating each other. Both having only recently been elected to the state Legislature, she said they align as "anti-establishment."
"We both agree that Pennsylvania needs to move forward," she said. "And we might have some differences on some issues. But I think we can look beyond that and win in November."
DelRosso added that she thinks she and Mastriano will be able to work together, though it's "premature" to say whether they will campaign separately or as a ticket.
"We really only have one phone call," she said. "I think that we'll figure it out as we go."
For his part, Mastriano retweeted a post from the Pennsylvania Federation of College Republicans that promoted him and DelRosso and called on the party to unite. He told a conservative media outlet after his win that "it's time to come together."
Still, Republicans harbor some regrets over how the primary played out. Nine candidates remained in the race until the final weekend, when two announced they were dropping out to endorse Barletta. And this was the first gubernatorial race in more than four decades in which the state party made no endorsement in the primary.
"In hindsight, I think they probably regret that they didn't just put people in a room and figure out who the best candidate was and go from there," Lou Capozzi, chairman of the Cumberland County GOP, said. "And they didn't do that. I think they were just trying to please too many people. It was all going to shake out, and it didn't. And here's where we're at."
With the wind appearing to be at Republicans' backs this fall, La Torre said Mastriano's victory in the primary amounts to the state GOP blowing "a golden opportunity."
"Consultants got in the way and allowed a candidate with a passionate grassroots to sweep in and beat everybody," he said. "And the Republican Party in Pennsylvania needs to take a real hard look at itself. A lot of people made a lot of money in this race and didn't back a winner."
Mastriano's presence could have broader implications for candidates up and down the ballot. Sean Parnell, the former Trump-backed Senate candidate in Pennsylvania who dropped out last fall after losing a child custody battle with his estranged wife, told NBC News in a text message that the eventual Senate nominee will face "a crazy dynamic" with Mastriano on the ticket.
Parnell said the nominee "will have to be careful campaigning with Doug." (Parnell supports David McCormick, who appeared headed for a recount Friday with Dr. Mehmet Oz for the state's GOP Senate nomination.)
As governor, Mastriano would have the ability to appoint a secretary of state to oversee elections, meaning an election denier would have great control over voting in one of the most pivotal presidential swing states. Already, he has said he would appoint someone to "reset" the voter rolls and make all Pennsylvania voters re-register.
He has zeroed in on hot-button cultural issues and pledged to virtually eliminate abortion rights in the state. At a rally this month, Mastriano joked that his administration would be so far to the right that Florida Gov. Ron DeSantis, a fellow Republican, would look "amateur."
To counter Mastriano, Democrats are expected to try to make the election a referendum on preserving democracy and abortion rights, betting that his far-right posture will activate Democratic voters to turn out in droves. On Friday, the Pennsylvania Democratic Party held a news conference to highlight Mastriano's position on abortion.
"What should scare people is, if he's given the authority to serve as governor, he's made clear that he would appoint a slate of electors that represent the winner that he wants, as opposed to respecting the will of the people," Shapiro said in an interview. "Our democracy was born right down the street here. And I think it is under attack and at risk here in Pennsylvania if he becomes our governor."
Rep. Brendan Boyle, D-Pa., called Mastriano "literally a Jan. 6 insurrectionist," and described his ascent through the Republican ranks as "frightening" - a sharp break from the mainstream candidates from both parties that Pennsylvania is known for electing statewide.
"To think that a Republican nominee for governor of Pennsylvania would be a far-right QAnon devotee who was at the 'Stop the Steal' rally and, by some accounts, part of the march to the Capitol - it is not surprising but it is shocking," Boyle said.
Democratic organizers in the state said Mastriano's rise is a five-alarm fire.
"It's definitely going to motivate me to knock as many doors as I can, to get out as many votes as I can," said Michael Huff, a lawyer based in Philadelphia, who attended a Shapiro event over the weekend. "So many of our civil rights are on the line right now."
If Mastriano is elected governor, he said, there's a fear that "Trump gets into power" even if he loses again in 2024.
On his Truth Social platform, Trump rejected the idea that Shapiro wanted to face Mastriano, saying any such claim is "DISINFORMATION!" Shapiro's campaign had placed a statewide ad ahead of the primary that seemed to suggest it viewed Mastriano as the weakest general election candidate.
Josh Novotney, a former campaign finance director for Sen. Pat Toomey, R-Pa., said Mastriano's passionate support combined with a bad environment for Democrats could lead to his victory, regardless of how much he focuses on the 2020 election.
"It really depends if you're a swing vote and soccer mom in the Philadelphia suburbs and all he wants to talk about is how the election was stolen, or some other issue that you don't really like," he said. "Does that outweigh the fact there's no baby formula? And inflation is hot. And you think the White House is just blowing the economy up? So that is what we'll find out."