In 2012, President Barack Obama won Pennsylvania by more than 300,000 votes, a 5 percentage point edge over Republican nominee Mitt Romney. It was the sixth consecutive presidential election in which the Democratic nominee won the Keystone State, dating to 1992.

To some political observers, Pennsylvania could no longer be considered a political battleground like Florida and Ohio. “Pennsylvania is not a swing state,” Jim Burn, the state Democratic Party chairman, said at the time. “It hasn’t been for some time.”

Eight years later, there’s no disputing Pennsylvania’s status as one of a half-dozen or so pivotal battleground states in presidential elections. That might seem obvious: President-elect Joe Biden on Saturday was leading President Donald Trump by just 65,000 votes out of almost seven million cast, four years after Trump won the state by just 44,000 votes. Pennsylvania is so critical that the Trump campaign, in a last-ditch effort to stave off defeat, has filed a lawsuit seeking to prevent the state from certifying the results.

But when Trump narrowly defeated Hillary Clinton in 2016, some political strategists believed it was an aberration: He’d defeated a historically unpopular candidate, after all, by just 77,000 votes across three states that delivered him the Electoral College. And he lost the popular vote.

This election showed that Trump’s 2016 coalition in Pennsylvania was no fluke. Despite a once-in-a-century pandemic and ensuing economic collapse, he got more votes and accomplished his goal of turning out even more white working-class voters in rural areas than he did four years ago. His vote totals also went up in Philadelphia and its suburbs.

But just as Trump energized his own supporters to go to the polls, he also roused historic Democratic turnout — especially in the suburbs, where Biden built an advantage that proved to be insurmountable.

“Pennsylvania is definitely a purple state,” said Lt. Gov. John Fetterman, a Democrat from Allegheny County. “It’s going to remain that way for another few cycles at least because it’s really who we are as a state.”

» READ MORE: How Joe Biden won Pennsylvania

The question going forward is what happens to these political coalitions once Trump is out of the White House in January.

Can Republicans win back suburbanites, many of whom were repelled by Trump’s conduct, while also holding on to their new, Trump-forged base? Without Trump on the ballot, can Democrats sustain their coalition of Black voters, young progressives, women, and suburban moderates?

A lot will depend on what Trump does next. He could well be on the ballot again in 2024, and even if he doesn’t run again, he’ll likely hold considerable sway over the party’s direction, given his deep popularity with Republican voters.

“One thing I’m curious about is to see whether or not Donald Trump’s base is going to be similar to Barack Obama’s,” said Rogette Harris, chairwoman of the Dauphin County Democrats. “Meaning, there are voters who voted strictly for Obama but Democrats haven’t been able to get to come out since. I’m curious to see if that’s going to be the same with Trump’s base.”

The first big test in Pennsylvania will come in 2022, when the state holds elections for the U.S. Senate and governor. The national climate will probably favor Republicans: Historically, the party that occupies the White House suffers losses during a new president’s first midterm elections.

» READ MORE: Pennsylvania Republicans are parroting Trump’s false election claims as the post-Trump GOP takes shape

So far, many Pennsylvania Republicans appear to be operating on the assumption that Trump will play a role in deciding GOP primary campaigns that year. Multiple Republican members of Congress and state lawmakers have been echoing the president’s baseless claims about voter fraud and casting doubt on the integrity of the election despite no evidence of widespread fraud.

“The president will continue to be a leader of the party if he wants to be,” said Rob Gleason, a former chairman of the state GOP. “He can be very effective in what transpires in the 2022 elections, because this election will still be fresh in the minds of a lot of people.”

As the GOP tries to retain the support of Trump voters who either used to back Democrats or previously weren’t very engaged in politics, it may need a new approach to be more competitive in the Philadelphia suburbs. Biden won the city’s four collar counties by more than 283,000 votes, a 50% increase over Clinton’s 188,000-vote edge there and double Obama’s 2012 margin.

“We need to recapture the people in Montgomery, Chester, Delaware, and Bucks that did not support the president,” Gleason said. “We need to get them back.”

Matthew J. Brouillette, a Pennsylvania conservative activist and treasurer of the GOP group Commonwealth Leaders Fund, said Trump “energized a number of new voters, and he was very attractive to an interesting part of the electorate that used to be solidly Democrat, that being working-class people in rural areas of the state, and urban areas.”

“The question is, can that be maintained within the Republican Party? I think it will,” he said. “I think that the positions of the Democratic Party have really pushed out working-class families from that party.”

» READ MORE: Suburban voters in Pennsylvania rejected Trump — but not the Republican Party

Beyond the presidential election, Pennsylvania strategists in both parties are starting to scour results from down-ballot races.

In 2012 and 2016, Democrats swept all three statewide row-office elections. But this year, Republicans won the open seat for auditor general and defeated incumbent Treasurer Joe Torsella, a Democrat who had aspirations for higher office. Those were the first GOP wins in statewide row-office elections since 2008. Attorney General Josh Shapiro, a Democrat widely seen as an early party front-runner for governor, was reelected to a second term.

The congressional delegation remains split among the parties, 9-9, after all incumbents won reelection. And Republicans maintained comfortable majorities in both chambers of the state legislature.

Brouillette said that showed voters had rejected “the Democrats' substance, whether it was Tom Wolf’s lockdowns, the defunding of the police push, to just the democratic socialism that is on the rise within the Democratic Party.”

Democrats are wondering whether their down-ballot troubles this year are outliers amid a presidential election with historic turnout — or whether the losses exposed a deeper vulnerability.

“I think we are definitely a swing, battleground state," said Sinceré Harris, a senior adviser to the Biden campaign in Pennsylvania and former executive director of the state party. “I do think overall the demographics tend to favor Democrats when everything’s said and done.”

But, she said, “nothing is a slam dunk.”