HARRISBURG, Pa. — Pittsburgh Mayor Bill Peduto lost his bid for re-election Tuesday to Ed Gainey, a five-term state representative, as the city took a big step toward electing its first Black chief executive.

Peduto, a Democrat, had been seeking a third term against three primary challengers but instead called to congratulate Gainey, “Wishing him well” in a tweet late Tuesday.

Gainey was all but assured a victory in November in the heavily Democratic city. He had consistently made the campaign about equality for Black and poor residents, and accused Peduto of failing to ensure equity in policing, housing and other areas. At one point, he called Pittsburgh “a tale of two cities.”

“One person can’t change a city. A city is changed when we all come together to improve the quality of life for everybody,” Gainey told supporters late Tuesday.

Statewide, Pennsylvania voters were given the opportunity to limit a governor’s emergency authority — more than a year after Gov. Tom Wolf’s pandemic restrictions drew fierce backlash among legislative Republicans — in an otherwise quiet off-year primary election that also included balloting for an open seat on the state’s highest court.

Voters of all kinds, including independents, were allowed to vote on four ballot questions, including two that stemmed from Republican lawmakers’ dissatisfaction with how Wolf, a Democrat, wielded his authority during the COVID-19 crisis.

It was the first vote of its kind since the coronavirus outbreak, as Republicans in nearly every state have sought to roll back governors’ authority during disaster emergencies.

For Republicans, the top-of-the-ticket race was an open state Supreme Court seat, with three GOP candidates vying for the nomination. The Democratic candidate ran unopposed.

Voters also decided whether to write civil rights protections for race and ethnicity into the state constitution, while Philadelphia’s progressive district attorney, vying for a second term, fended off a primary challenge.