In a divided country, half of America this weekend fell hard for Philadelphia.

First, a batch of mail ballot results made public Friday gave former Vice President Joe Biden his first, narrow lead over President Donald Trump in Pennsylvania. Then another batch of results released Saturday secured victory for Biden in the state, tipping the Electoral College his way.

Biden fans rejoiced with quick takes on social media and exuberance in the street. Trump supporters, including his personal lawyer Rudy Giuliani, continued to level false claims of fraud. Philadelphia was victor or villain, depending on your political point of view.

The numbers tell a more textured tale.

Trump actually did better in Philadelphia in 2020 than in 2016, when he won almost 109,000 votes (Hillary Clinton won about 584,000 in the overwhelmingly Democratic city.) Trump took two of the city’s 66 wards that year — the 26th Ward in South Philadelphia and the 66th Ward in Northeast Philadelphia.

While the final 2020 ballots were still being counted in Philadelphia, Trump had logged almost 127,000 votes as of Saturday afternoon, just over 18% of the votes in the city. Biden won 81%, with about 561,000 votes.

And Trump didn’t just hold on to the 26th and 66th Wards. He also picked up Northeast Philadelphia’s 58th Ward. He also won divisions in some wards on the east side of South Philadelphia and along the river wards of Port Richmond, Bridesburg, and Tacony.

Former U.S. Rep. Bob Brady, between celebratory calls Saturday with Biden and House Speaker Nancy Pelosi, shrugged off Trump’s gains in the city.

“That’s fine,” Brady said of the three wards. “He can win all of them, but they’re not going to call him Mr. President anymore.”

Former Pennsylvania Gov. Ed Rendell, who cautioned Clinton four years ago about the phenomenon of the “shy Trump voter” — people who support the president but don’t say so to pollsters — said that was still a factor in this election.

“Trump’s message is appealing to people who are angry, to people who are afraid,” Rendell said. “He delivers that message in a way that is far from the truth but in an effective or dramatic way for people who take to it. He was a formidable campaigner.”

State Rep. Kevin Boyle, a Democrat who represents a Northeast Philadelphia district where Trump won some divisions, says his party is struggling to appeal to white working-class voters.

“I think the Trump campaign was able to demonize Democratic positions and make them out to be something they aren’t," Boyle said. “There’s no Democrats that I’m aware of in Philadelphia who want to get rid of the police. But I was seeing that. People were believing that.”

Boyle said Trump’s campaign was also effective at galvanizing support among immigrants and first- and second-generation Americans of Russian, Ukrainian, and Indian descent in Northeast Philadelphia.

“I think what caught a lot of Democrats by surprise was, even with this maximized turnout, Trump was competitive,” Boyle said. “I think a lot of Democrats were thinking this was going to be a Democratic landslide.”

Mark Nevins, a Democratic political consultant in Philadelphia, saw space for Trump to grow in the 2020 results because of fewer third-party candidates on the ballot this year. Three third-party candidates in 2016 took in nearly 15,000 votes, a combined 2.2% of the total. This year, Libertarian Jo Jorgensen collected just over 4,500 votes in Tuesday’s election, less than 1%, and the Green Party’s presidential ticket was kicked off the ballot.

David Thornburgh, president of the Committee of Seventy, a good-government election watchdog group, predicted a continuing battle between Republicans and Democrats over working-class voters. And he saw that fight starting on the margins, noting that Trump “chipped away” at Biden’s support in the city while Biden did the same in counties where Trump was running strong.

“It was a game of inches,” Thornburg said. “Chip a little off here, chip a little off there.”