BLOOMSBURG, Pa. — In the early days of the Covid-19 pandemic, Diane Fisher, a nurse from Weatherly, Pa., was surfing through videos on Facebook when she came across a livestream from Doug Mastriano, a Pennsylvania state senator.Starting in late March 2020, Mr. Mastriano had beamed regularly into Facebook from his living room, offering his increasingly strident denunciations of the state’s quarantine policies and answering questions from his viewers, sometimes as often as six nights a week and for as long as an hour at a stretch.“People were upset, and they were fearful about things,” Ms. Fisher said. “And he would tell us what was going on.”Ms. Fisher told her family and her friends about what Mr. Mastriano billed as “fireside chats,” after Franklin D. Roosevelt’s radio broadcasts during the Depression and World War II. “The next thing you knew,” she recalled, “there was 5,000 people watching.”Mr. Mastriano’s rise from obscure and inexperienced far-right politician to Republican standard-bearer in Pennsylvania’s governor’s race was swift, stunning and powered by social media. Although he is perhaps better known for challenging the results of the 2020 presidential election and calling the separation of church and state a “myth,” Mr. Mastriano built his foundation of support on his innovative use of Facebook in the crucible of the early pandemic, connecting directly with anxious and isolated Americans who became an uncommonly loyal base for his primary campaign.He is now the G.O.P. nominee in perhaps the most closely watched race for governor in the country, in part because it would place a 2020 election denier in control of a major battleground state’s election system. Both President Biden and former President Donald J. Trump are making campaign appearances in Pennsylvania this week. As the race enters its last months, one of the central questions is whether the online mobilization that Mr. Mastriano successfully wielded against his own party establishment will prove similarly effective against Josh Shapiro, his Democratic rival — or whether a political movement nurtured in the hothouse of right-wing social media discontent will be unable or unwilling to transcend it.Mr. Mastriano has continued to run a convention-defying campaign. He employs political neophytes in key positions and has for months refused to interact with mainstream national and local reporters beyond expelling them from events. (His campaign did not respond to requests for comment for this article.)A Mastriano event this month in Pittsburgh. His base is animated, but he has not yet sought to reach the broader electorate.Maddie McGarvey for The New York TimesHe grants interviews almost exclusively to friendly radio and TV shows and podcasts that share Mr. Mastriano’s far-right politics, and continues to heavily rely on Facebook to reach voters directly.“It is the best-executed and most radical ‘ghost the media’ strategy in this cycle,” said Michael Caputo, a former Trump campaign adviser, who said other Republican strategists were watching Mr. Mastriano’s example closely.More Coverage of the 2022 Midterm ElectionsEvidence Against a Red Wave: Since the fall of Roe v. Wade, it’s hard to see the once-clear signs of a Republican advantage. A strong Democratic showing in a New York special election is the latest example.G.O.P.’s Dimming Hopes: Republicans are still favored in the fall House races, but former President Donald J. Trump and abortion are scrambling the picture in ways that distress party insiders.A Surprise Race: Senator Michael Bennet, a Democrat seeking re-election in Colorado, is facing an unexpected challenge from Joe O’Dea, a novice Republican emphasizing more moderate positions.Campaign Ads: In what critics say is a dangerous gamble, Democrats are elevating far-right candidates in G.O.P. primaries, believing they’ll be easier to defeat in November. We analyzed the ads they’re using to do it.“It’s never been done before. He’s on a spacewalk,” he said. “And the question we’re all asking is, does he make it back to the capsule?”Although Mr. Mastriano no longer hosts fireside chats, his campaign posts several times more often a day on Facebook than most candidates, according to Kyle Tharp, the author of the newsletter FWIW, which tracks digital politics. His campaign’s Facebook post engagements have been comparable to those of Mr. Shapiro, despite Mr. Shapiro’s spending far more on digital advertising.“He is a Facebook power user,” Mr. Tharp said.But Mr. Mastriano’s campaign has done little to expand his reach outside his loyal base, even as polls since the primary have consistently shown him trailing Mr. Shapiro, Pennsylvania’s attorney general, albeit often narrowly. And Mr. Mastriano’s efforts to add to his audience on the right through advertising on Gab, a platform favored by white nationalists, prompted a rare retreat in the face of criticism last month.A career Army officer until his retirement in 2017 and a hard-line social conservative, Mr. Mastriano won a special election for the State Senate in 2019 after campaigning on his opposition to what he described as the “barbaric holocaust” of legal abortion and his view that the United States is an inherently Christian nation whose Constitution is incompatible with other faiths. But he was known to few outside his district until he began his pandemic broadcasts in late March 2020.In the live videos, Mr. Mastriano was unguarded and at times emotional, giving friendly shout-outs to familiar names in the chat window. His fireside chats arrived at a fertile moment on the platform, when conservative and right-wing activists were using Facebook to assemble new organizations and campaigns to convert discontent into action — first with the Covid lockdowns and, later, the 2020 election outcome.Mr. Mastriano linked himself closely to these currents of activism in his home state, speaking at the groups’ demonstrations and events. A video he livestreamed from the first significant anti-lockdown rally on the steps of the State Capitol in Harrisburg in April 2020, armed with a selfie stick, eventually racked up more than 850,000 views.Mr. Mastriano on Nov. 7, 2020, the day Joseph R. Biden Jr. was elected. It was the first “Stop the Steal” rally in Harrisburg.Julio Cortez/Associated PressAfter the presidential election was called for Mr. Biden on Nov. 7, 2020, Mr. Mastriano was greeted as a star at the first “Stop the Steal” rally at the capitol in Harrisburg that afternoon. He became one of the most prominent faces of the movement to overturn the election in Pennsylvania, working with Mr. Trump’s lawyers to publicize widely debunked claims regarding election malfeasance and to send a slate of “alternate” electors to Washington, on the spurious legal theory that they could be used to overturn the outcome. (He would later be present at the U.S. Capitol on Jan. 6, 2021, though there is no evidence that he entered the building.)When Republican colleagues in the State Senate criticized those schemes and Mr. Mastriano by name, he pointed to the size of his online army.“I have more followers on Facebook alone than all 49 other senators combined,” Mr. Mastriano told Steve Turley, a local right-wing podcast host, in an interview. “That any colleague or fellow Republican would think that it would be a good idea to throw me under the bus with that kind of reach — I mean, they’re just not very smart people.”Mr. Mastriano was eventually removed from the chairmanship of a State Senate committee overseeing an investigation he had championed into the state’s election results, and he was later expelled from the Senate’s Republican caucus — episodes that burnished his credentials with supporters suspicious of the state’s G.O.P. establishment. His campaign for governor, which he formally announced this January, has drawn on not only the base he has cultivated since 2020 but also on the right-wing grass-roots groups with whom he has made common cause on Covid and the 2020 election.“That whole movement is rock-solid behind him,” said Sam Faddis, the leader of UnitePA, a self-described Patriot group based in Susquehanna County, Pa.When UnitePA hosted a rally on Aug. 27 in a horse arena in Bloomsburg, bringing together a coalition of groups in the state dedicated to overhauling the election system they insist was used to steal the election from Mr. Trump, many of the activists who spoke offered praise for Mr. Mastriano and his candidacy. From the stage, Tabitha Valleau, the leader of the organization FreePA, gave detailed instructions for how to volunteer for Mr. Mastriano’s campaign.The crowd of about 500, most of whom stayed for all of the nearly six-hour rally, was full of Mastriano supporters, including Ms. Fisher. “He helped us through a bad time,” she said. “He stuck with his people.”Charlie Gerow, a veteran Pennsylvania Republican operative and candidate for governor who lost to Mr. Mastriano in May, said this loyal following was Mr. Mastriano’s greatest strength. “He’s leveraged that audience on every mission he’s undertaken,” he said.An anti-vaccine and anti-mask rally in Harrisburg in August 2021. Mr. Mastriano built his early support around people angry at government efforts to control the pandemic.Paul Weaver/SOPA Images/LightRocket, via Getty ImagesBut with recent polls showing Mr. Mastriano lagging between 3 and 10 points behind Mr. Shapiro, Mr. Gerow is among the strategists doubting his primary strategy will translate to a general electorate.“I think it’s going to be important for him to run a more traditional campaign, dealing with the regular media even when it’s unpalatable and unfriendly,” Mr. Gerow said.Mr. Mastriano has also drawn criticism for his efforts to expand his social-media reach beyond Facebook and Twitter into newer, fringier spaces on the right.In July, the liberal watchdog group Media Matters noted that Mr. Mastriano, according to his campaign filings, had paid $5,000 to the far-right social media platform Gab, which gained notoriety in 2018 after the suspect charged in the shooting at the Tree of Life Synagogue in Pittsburgh, in which 11 people were killed, used the platform to detail his racist and antisemitic views and plans for the shooting. Gab’s chief executive, Andrew Torba, who lives in Pennsylvania, has made antisemitic statements himself and appeared at a white nationalist conference this spring.Mr. Torba and Mr. Mastriano had praised each other in a podcast interview in May, after which Mr. Mastriano had spoken hopefully of Gab’s audience. “Apparently about a million of them are in Pennsylvania,” he said on his own livestream, “so we’ll have some good reach.”Campaign signs at a Pittsburgh rally. Democrats are cautioning not to underestimate Mr. Mastriano.Maddie McGarvey for The New York TimesMr. Torba, who did not respond to emailed requests for comment, has continued to champion Mr. Mastriano, describing the Pennsylvania governor’s race as “the most important election of the 2022 midterms, because Doug is an outspoken Christian,” in a video he posted in late July. He added, “We’re going to take this country back for the glory of God.”But after initially standing his ground, Mr. Mastriano finally bowed to sustained criticism from Democrats and Republicans alike and closed his personal account with Gab early this month, issuing a brief statement denouncing antisemitism.This month Mr. Shapiro, who is Jewish, spent $1 million on TV ads highlighting Mastriano’s connections to Gab. “We cannot allow this to become normalized — Doug Mastriano is dangerous and extreme, and we must defeat him in November,” said Will Simons, a spokesman for the Shapiro campaign.The push reflected a view that one of Mr. Mastriano’s core vulnerabilities lies in his vast online footprint, with its hours of freewheeling conversation in spaces frequented by far-right voices.Still, some Democrats who watched Mr. Mastriano’s rapid rise at close range have cautioned against counting him out. “Mastriano’s been underestimated by his own party,” said Brit Crampsie, a political consultant who was until recently the State Senate Democrats’ spokeswoman. “I fear him being underestimated by the Democrats. I wouldn’t rule him out.” More