In long and short lines, near boarded up stores, and in polling places within earshot of chanting protesters, Pennsylvanians came out Tuesday to cast their votes in the unprecedented midst of a deadly pandemic and the greatest urban unrest in a generation.

Many said they voted as their own form of democratic expression, the importance of which felt heightened this week. Others said they were in line because their requested mail ballot never showed up.

On the whole, a primary day flipped on its head — and rescheduled from April — ran largely smoothly for election officials operating with a skeletal staff and a fraction of the polling places typically open. But the success of the operations of this election — and its results — may lie in the days ahead, as officials process stacks of mail ballots, which more than 1.9 million Pennsylvanians requested.

“There was nothing that was gonna keep me from voting today, even during a pandemic and with a curfew,” said Paul Griffing, who put his ballot in a drop box near City Hall.

The drop box became a miniature place of celebration, where people took photos of one another and even applauded as each voter placed an envelope in the red, white, and blue mailbox. They mourned the absence of “I voted stickers,” which those who chose the mail-in method did not get.

Pennsylvania Gov. Tom Wolf extended the deadline to June 9 for mail ballots from Philadelphia, Pittsburgh, and several other counties, but those ballots had to be postmarked by 8 p.m. Tuesday.

In the city, the primary coincided with the fourth day of protests, clashes with the police, and property damage, sparked by the death of George Floyd as a Minneapolis police officer knelt on his neck. A curfew was set for 8:30 p.m., after polls closed. The city also remained in the “red phase” of the state’s public health restrictions, largely shut down even before the protests.

Despite all of that, voters said they mostly felt safe casting votes in person.

“I just made sure I had a mask,” said Venus Little, 63, who voted at the Upper Darby Municipal Building, near where National Guardsman had been deployed in response to looting in the area.

“We need a change in Washington,” added Little, who said she was excited to vote for Joe Biden to be the Democratic nominee for president. “I’m just hoping people turn out,” she said. “It’s sad what happened to George Floyd. It’s been going on for ages. They just had enough. I hope they see what’s important, and that’s the election.”

The most serious election issue in the region was reported in Northwest Philadelphia, where an already high-trafficked voting neighborhood had to contend with a mix-up: incorrect machines delivered to three polling locations. Yellow tape on the sidewalk directed voters to stand a few feet apart, though that extended less than halfway down the line of voters, which at one point stretched around the corner and part of the way down another block.

Rasheen White, 50, cast her ballot after waiting an hour and a half at the Masjidullah mosque and Islamic community center by the border of the East Mount Airy and West Oak Lane neighborhoods.

“I wanted to come,” she said. “Just doing my duty.”

The correct machines rolled in by late morning, but wait times of as long as 90 minutes persisted throughout the day. If people were getting agitated, they didn’t show it.

“There’s a certain peace with these people standing in line,” said Councilmember Cherelle Parker, who patrolled the polling place encouraging patience — and marveling at it. “They’re saying, ‘We don’t care how long it takes. We are standing. Because we gon’ vote.' That’s resilience," she said. "That’s what you’re getting from Philadelphia today. ... And it’s across the city of Philadelphia. And particularly in the black community.”

Voters said this year, more than most, they believed that voting was a moral imperative.

When a few people stepped out of a long line at the Masjidullah polling place, a woman shouted, “That’s what they want!”

Chris Mckant, 32, of Mount Airy, said he feared that a lot of young people protesting don’t think their vote can change anything.

“A lot of people right now are distracted because of what’s going on across the city and the country,” he said. “People feel their priorities are somewhere else. The vote does matter. I know that 1,000%.”

“The main thing I’ve learned is I definitely need to be more involved and active in local politics," said Mike Magaraci, 29, of Graduate Hospital, who dropped his mail ballot off at City Hall. "Decisions that are made that don’t affect me as a white male, affect a lot of people I care about. Vote here. Vote in November. That’s my plan from all of this.”

Magaraci was particularly motivated to vote for Bernie Sanders, whose name was still on the ballot, in hopes he rakes up enough delegates to influence the party platform at the Democratic National Convention.

How the combined forces of protests and a pandemic affect outcomes remains to be seen. In the coming weeks, political scientists, political organizers, and campaigns will analyze voter behavior and how to apply its lessons to the high-stakes election in November.

Challengers had an especially difficult time campaigning against incumbents, with in-person activities suspended and fund-raising difficult.

For many voters, their place in line was a necessity, not a choice, because they said they never received mail ballots. There were also reports of thousands of provisional ballots cast, likely due to problems with mail ballots.

Kerry Dowd, of West Philadelphia, said he applied for a mail ballot three weeks ago but it never came. So he waited about 30 minutes to vote in person.

“I need a change. I think we need a change from the bottom to the top,” he said, calling Biden “a good soldier.”

“I think he can stabilize some of the things going on," he said. "I think everybody likes to see things turned upside down but when they get turned upside down, they realize, ‘This isn’t great.’ It’s time to get back to what we were, which is a country that was respected around the world.”

Others said they were voting in person because they were skeptical of voting by mail, which has extremely few incidents of fraud. That was a refrain in the heavily Democratic Northwest and in more Republican parts of Bucks County.

“There’s a strong distrust for this vote-by-mail process,” Parker said of her constituents in Northwest Philadelphia. “They know that there are folks across this nation and this city and all over who would prefer that they did not vote."

In Bucks County, Ryan Meehan, son of Andy Meehan, who is challenging Republican Rep. Brian Fitzpatrick said, “We want everyone to go in and vote in person. We don’t want any mail-in ballots. We don’t want anything going on. We don’t really trust mail-in ballots.”

It was the busiest day of voting nationally since the pandemic took hold in mid-March — called the Super Tuesday of COVID-19, since seven other states and the District of Columbia held primaries. They shared many of the same issues, from closed polling places to the turmoil on the streets.

Lucille Alexander, of West Philadelphia, described it with mixed emotions.

“It’s a weird time to be voting,” she said. “It feels extra important to vote but it also feels like you worry nothing’s gonna happen anyway. I was filling out my ballot and I was like — I hope this matters — I don’t really know if it does but I have to believe that it does and do what I can in the off chance it does.”

Staff writers Allison Steele, Chris Brennan, Jonathan Lai, Justine McDaniel, Jonathan Tamari, Astrid Rodrigues, Raishad Hardnett and Sean Walsh contributed to this article.