Yusef Salaam, one of the so-called Central Park 5, wrongfully convicted of the rape and assault of a female jogger, held a commanding lead over two Assembly members in what would be a major upset in the Democratic primary for a Harlem City Council seat.

Mr. Salaam had nearly twice the number of votes of his closest competitor, Assemblywoman Inez Dickens, 73, who conceded defeat on Tuesday night, according to her spokeswoman. It was not clear if Mr. Salaam had drawn more than 50 percent of the votes; if he fell short of that threshold, voters’ ranked choices would be tabulated next week.

In East New York, Councilman Charles Barron also seemed at risk of losing his seat; he trailed his Democratic challenger, Chris Banks, by three percentage points with 95 percent of votes counted.

Mr. Banks had the broad support of labor against Mr. Barron, with a coalition of union groups spending more than $100,000 on the race. Earlier this month, Mr. Banks appeared on a flier with Representative Hakeem Jeffries, the leader of Democrats in the House.

Incumbents easily held off primary challenges in Democratic primaries for district attorney in Queens and the Bronx; further north, a Council race in Buffalo was won by a woman whose son was shot in the Tops supermarket racist massacre.

In New York City, just over 149,000 people had cast their ballots as of 6 p.m., according to the City Board of Elections. That includes 44,611 votes that were cast during the nine-day early voting period that began June 17 and ended on Sunday — less than a quarter of the early-voting turnout two years ago, when candidates for mayor were competing in the primary.

There were contested primaries in New York City Council contests across the boroughs, with the races for a two-year term instead of the usual four years because of redistricting. Every seat on the City Council is up for re-election, but less than half of the 51 Council seats are being contested in primaries, and of those, 13 races feature more than two candidates — making ranked-choice voting, where voters can rank up to five candidates in order of preference, necessary.

Ranked-choice voting was not be used in the races for district attorney.

The incumbent district attorneys of the Bronx and Queens both fended off challengers to win their respective Democratic primaries, according to The Associated Press.

In the Bronx, Darcel Clark defeated Tess Cohen, a civil rights and criminal defense lawyer, who was the first person to challenge Ms. Clark in a primary. With 82 percent of the votes counted, Ms. Clark led Ms. Cohen by more than 12,000 votes.

In Queens, Melinda Katz, rebuffed a challenge from her right, defeating George Grasso, a former Police Department first deputy commissioner who attacked Ms. Katz as being soft on crime. Ms. Katz disputed the accusation by pointing to her focus on retail theft, gang takedowns and gun seizures.

The challenge from Mr. Grasso came four years after Ms. Katz narrowly defeated a democratic socialist who wanted to abolish the police and end cash bail. Ms. Katz was leading Mr. Grasso and another opponent, Devian Daniels, by 33,000 votes with 89 percent of the vote counted.

Ms. Clark, whose tenure began in 2016, was the first Black woman to be elected district attorney in New York. She grew up in the Bronx, was raised in public housing and went to public schools.

She said that her biggest accomplishment as district attorney has been “putting humanity” into the criminal justice system.

“I firmly believe that safety and justice go hand and hand and I’m more energized than ever to make sure that we continue this work,” Ms. Clark said in her victory speech.

In Harlem, Mr. Salaam appeared poised to win the contest among three moderate Democrats seeking to replace Kristin Richardson Jordan, a democratic socialist who dropped out last month.

Ms. Jordan faced questions about her belief that the police should be abolished and about her far-left stance on housing development. Her name remained on the ballot, and she finished last, behind Al Taylor, 65, who is serving his sixth year in the Assembly.

Mr. Salaam leaned heavily on the story of his conviction, the nearly seven years he spent in prison, and as a target of President Donald J. Trump, who took out full pages ads in The New York Times and other newspapers calling for the death penalty in the jogger attack.

The major issues in the historically Black neighborhood include the loss of Black residents, lack of affordable housing and a saturation of drug treatment centers and social service providers.

“We need to vote in our best interests to insure the next person to assume this seat will represent what the future of Harlem looks like,” Mr. Salaam said while campaigning in Harlem on Tuesday afternoon.

During his election night speech at Harlem Tavern, Mr. Salaam invoked the rapper Drake and said he “started from the bottom” but had arrived.

“This campaign has been about those who have been counted out. This campaign has been about those who have been forgotten,” Mr. Salaam said. “This campaign has been about our Harlem community who has been pushed into the margins of life and made to believe that they were supposed to be there.”

Mr. Salaam, 49, and Mr. Taylor had cross-endorsed each other, asking voters to rank them first and second.

Ms. Dickens’s defeat was a blow to Mayor Eric Adams who endorsed her toward the end of the race in an effort to boost her campaign.

Ms. Dickens and Mr. Taylor contended that their experience would make a difference, while Mr. Salaam, who moved back to the city from Georgia to run for the seat, argued it was time for a generational shift.

“I’ve often said on the campaign trail that I am not a seasoned politician,” Mr. Salaam said. “So therefore, this was not politics as usual.”

In Lower Manhattan, the incumbent Chris Marte, a progressive Democrat, defeated challengers Susan Lee, a consultant; Ursila Jung, a private investor; and Pooi Stewart, a substitute teacher. All of the challengers emphasized public safety and education and argued that Mr. Marte was too far to the left.

Mr. Marte was did not leave the City Council’s Progressive Caucus after it asked members to agree to a statement of principles that included less funding for the police. He said public safety was linked to economic well being and not just more policing.

In the Bronx Councilwoman Marjorie Velázquezdefeated her opponents who criticized her because she backed the rezoning of Bruckner Boulevard in Throgs Neck, which will bring affordable housing to the area.

Ms. Velázquez, who left the Council’s Progressive Caucus earlier this year, said she was often perceived as a democratic socialist but saw herself as a “pragmatic” and moderate Democrat who approved the rezoning because it would bring jobs and housing for seniors.

In southern Brooklyn, Susan Zhuang, the chief of staff for Assemblyman William Colton, defeated two fellow Asian American Democrats running in a newly formed district.

Ms. Zhuang defeated Wai Yee Chan, the executive director at Homecrest Community Servicesand Stanley Ng, a retired computer programmer.

In a district that has swung to the right in recent years, the winner of the Democratic primary is expected to face a tough general election challenge from the Republican primary winner.

Vito J. LaBella, a conservative Republican and former Police Department officer, iwas locked in a tight contest against Ying Tan, who works in senior services, in that primary. Mr. LaBella ran uncontested on the Conservative line.

In Buffalo, Zeneta Everhart, a political newcomer whose son was a victim of a racist shooting at a Tops supermarket last May, defeated a well-known progressive, India Walton, in a primary race for a seat on the city’s Common Council.

The seat represents Masten, an East Side district adjacent to where the Tops is located and a traditional base of Black political power in Buffalo, New York’s second largest city and a Democratic stronghold.

Ms. Everhart, a former television news producer who works for State Senator Timothy Kennedy, testified in front of Congress after the shooting, in which her son, Zaire Goodman, was shot in the neck but survived. Ten other people — all Black — were killed by the gunman, who targeted East Buffalo because of its large Black population.

Ms. Walton, a democratic socialist, became a liberal star after she defeated Mayor Byron Brown in a primary in June 2021, only to lose the general election that fall after Mr. Brown mounted a write-in campaign.

In this campaign, Ms. Walton had criticized Ms. Everhart’s connections to the Democratic establishment, which included endorsements from the county Democratic Committee and Senator Chuck Schumer. But returns on Tuesday showed Ms. Everhart took about two-thirds of the vote.

There were 13 New York City Council contests involving three or more candidates. If no candidate clearly attracted more than 50 percent of the vote, the City Board of Elections will use the ranked-choice system — but not until July 5. The board usually runs the first ranked-choice calculation seven days after the vote, but because that day falls on the Fourth of July, the tabulation will be delayed a day.

If necessary, additional ranked-choice tabulations will be held each week afterward, on July 11 and July 18, said Vincent Ignizio, the deputy executive director of the Board of Elections.

About 15,000 absentee ballots have already been filed, but additional absentee ballots can be received a week after Election Day as long as they are postmarked by June 27.

Under recent changes to state law, voters will also have an opportunity to cure or fix mistakes on their absentee ballots. The tentative last day to receive absentee ballot cures is July 17.

Because of the low turnout, Board of Elections officials don’t expect that more than three rounds of ranked-choice voting tabulations will be required.

Susan Lerner, executive director of Common Cause New York, a government watchdog group, said ranked-choice voting gave people more options. “We heard some voters in our 2021 exit polling say that because they knew they had the ability to rank, they actually paid more attention to more candidates,” she said.

Jesse McKinley, James Barron and Lola Fadulu contributed reporting.