Spotlight PA is an independent, nonpartisan newsroom powered by The Philadelphia Inquirer in partnership with PennLive/The Patriot-News, TribLIVE/Pittsburgh Tribune-Review, and WITF Public Media. Sign up for our free newsletters.

Katie Meyer of Spotlight PA

HARRISBURG — Democrat Josh Shapiro has won the election to be Pennsylvania’s 48th governor, cruising to a decisive victory over far-right Republican Doug Mastriano. And in a close race, Democrat John Fetterman beat Republican opponent Dr. Mehmet Oz in Pennsylvania’s pivotal U.S. Senate race.

The Associated Press called the race for Shapiro around 12:15 a.m. Wednesday, with 82% of the votes in. At that time, the Democrat had captured 54.6% of the vote, according to unofficial results.

As of 6:30 a.m. Wednesday, Fetterman had collected about 50.16% of the votes counted compared with 47.42% for Oz, according to the Pennsylvania Department of State. News organizations including The Associated Press, ABC, NBC, CBS, Fox News, CNN and The New York Times had all projected Fetterman as the winner.

“While my name was on the ballot, it was always your rights, it was always your futures that were on the line right here in the commonwealth,” Shapiro said at a victory party in Montgomery County. “It was a test of whether or not we valued our rights and freedoms and whether we believed in opportunity for all Pennsylvanians. And tonight, I humbly stand before you as your governor-elect knowing that you met this moment.”

The AP’s election analysts call races when a “trailing candidate no longer has a path to victory” — an assessment the outlet makes by studying vote totals county by county and comparing returns with ballots left to count.

Mastriano, a state senator from Franklin County, spoke to supporters at a campaign party in Camp Hill shortly before midnight and did not concede.

Mastriano has been one of Pennsylvania’s most prominent proponents of baseless election fraud theories, and had wrongly claimed before Election Day that the slower pace for results because of mail ballots was an “attempt to have the fix in.”

Shapiro, of Montgomery County, has served since 2016 as the commonwealth’s attorney general. He has spent decades in Pennsylvania politics and is broadly seen as a moderate with a knack for building consensus and tricky backroom dealmaking.

In his race for governor, he sought to cast himself as the reasonable choice compared with Mastriano. In one ad, he called his opponent’s stated opposition to abortion in all cases “way too extreme.”

Shapiro, who says he supports Pennsylvania’s current abortion laws, which allow the procedure until 24 weeks and later in medical emergencies, leaned into the issue after the U.S. Supreme Court overturned Roe v. Wade, anticipating that voters would be galvanized by the ruling.

For his part, Mastriano has tried to argue throughout the race that his views, not Shapiro’s, are actually the mainstream ones. Most frequently, he bases that case on Shapiro’s defense of the state’s Covid-19 precautions as attorney general, and also blames Shapiro for crime rates and asserts without specific examples that Shapiro supports “woke gender ideology” and the “sexualization of minors.”

Doug Mastriano takes the stage with his wife Rebbie at his election night watch party in Camp Hill. Photo by Amanda Berg for Spotlight PA.

Shapiro has tried to stake out a middle ground on some of Pennsylvania’s most contentious issues — in some cases, by avoiding taking firm stances.

On the campaign trail, he avoided saying whether he will keep Pennsylvania in the Regional Greenhouse Gas Initiative — a plan in which energy producers purchase allowances to emit carbon dioxide, the profits from which go into renewable energy investments.

He has been a proponent of putting more money into public schools and routing that money through a funding formula designed to more fairly allocate resources. At the same time, he took a position some fellow Democrats see as contradictory — arguing that Pennsylvania should fund scholarships that allow students to leave public schools for private ones, if they want.

As attorney general, Shapiro’s office frequently went to court to defend Democratic Gov. Tom Wolf’s Covid-19 policies, which included school and business closures and mask mandates. But during his gubernatorial run, Shapiro broke with Wolf and much of the rest of his party, saying he thinks “folks got it wrong” on school and business shutdowns, and that he opposes mask and vaccine mandates.

After coasting through a primary in which he managed to emerge as the sole mainstream Democratic candidate, Shapiro entered the general election with a formidable financial advantage over Mastriano’s shoestring campaign.

After a stint working for Democrats in Washington, D.C., Shapiro began his elected career as a state representative in 2005, flipping a Montgomery County seat Republicans had held for 20 years. Six years later, he was elected to Montgomery County’s board of commissioners and became its chair, again ushering in a significant political shift — the first time in history that Democrats had been the majority in Montgomery County government.

It was in those roles that Shapiro began building his reputation as a pragmatist.

As a state representative, he helped broker a novel scheme that allowed Democrats to elect a hand-picked, cooperative Republican as state House speaker in order to maintain power in the chamber during a period of closely divided control. As a commissioner, his fellow county officials recognized him for helping to broker a period of unanimity on a board that had often been publicly acrimonious.

In 2016, with then-state Attorney General Kathleen Kane under indictment and her law license suspended, Shapiro was elected to his first statewide position. He promised to restore stability to an attorney general’s office plagued by scandal.

In the years since he has become perhaps best known for the office’s 2018 release of a landmark grand jury report on longstanding sexual abuse of children in Pennsylvania’s Catholic dioceses.

Other high-profile efforts during his time in office included criminally charging the energy company responsible for a controversial natural gas pipeline project, adding Pennsylvania to dozens of national lawsuits against the Trump administration for things like family separation at the southern border and reducing access to contraception, and defending Pennsylvania’s election laws against the Trump campaign and other Republicans’ efforts to invalidate ballots.

Shapiro will be taking over the governorship from Wolf, who was elected to two terms and constitutionally prohibited from seeking a third. His election marks the first time since 1967 that Pennsylvania has elected two consecutive governors from the same party.

The state’s next lieutenant governor will be state Rep. Austin Davis (D., Allegheny), the first Black person to hold that position. Davis said in a speech Tuesday that this “is a moment that defines us as a commonwealth, that says to extremists … that we won’t go back and we’ll never back down.”

Spotlight PA’s Angela Couloumbis and Stephen Caruso contributed reporting.

WHILE YOU’RE HERE… If you learned something from this story, pay it forward and become a member of Spotlight PA so someone else can in the future at Spotlight PA is funded by foundations and readers like you who are committed to accountability journalism that gets results.