NEW YORK (AP) - With less than six weeks to go, the Democratic primary that may decide the next mayor of New York City has reached a new stage of unpredictability.

Former presidential candidate Andrew Yang is clinging to front-runner status while City Comptroller Scott Stringer fights off a sexual misconduct allegation.

Brooklyn Borough President Eric Adams, a former police officer and founder of a law enforcement reform group, has seen his standing rise amid concern over a spike in shootings during the coronavirus pandemic - including gunfire that injured three bystanders in Times Square.

And The New York Times has given its coveted endorsement to a candidate who has been polling in the mid-single digits: Kathryn Garcia, a former city sanitation commissioner and veteran of several other city departments.

The race to succeed the term-limited Mayor Bill de Blasio, also a Democrat, chugged along for months with many New Yorkers too consumed by the coronavirus pandemic and the 2020 presidential election to notice.

But it is grabbing more attention now, with the June 22 Democratic primary looming, television advertisements starting to air and candidates increasingly meeting voters in person after a year of campaigning online because of the pandemic.

Eight top-tier candidates, of the more than two dozen who entered the race, faced off in their first televised debate Thursday, sparring remotely over policing and each other's records.

In addition to Yang, Adams, Stringer and Garcia, they were civil rights attorney Maya Wiley, former Citigroup executive Ray McGuire, former Obama housing secretary Shaun Donovan and former nonprofit executive Dianne Morales.

Adding to the race's complexity, the primary will be New York City's first mayoral race to be determined by ranked choice voting, a system that lets voters pick up to five candidates and rank them in order of preference.

Under the system, a candidate who trails in an initial round of vote tallying could still win the race, if enough people selected them as their second choice.

Yang has narrowly led in most polls, lifted by supporters who like his proposal for a universal basic income, but has been criticized by the left.

U.S. Rep. Alexandria Ocasio-Cortez slammed him this week over a tweet in which he said he was “standing with the people of Israel who are coming under bombardment attacks” from the militant group Hamas, but didn't mention Palestinian victims of retaliatory Israeli strikes.

Adams, 60, has trailed Yang in most voter surveys, but two polls released in the past 10 days have shown Adams slightly ahead.

Adams is campaigning as both a tough-talking former police detective and a Black man who was himself victimized by police brutality as a youth and later founded the reform group 100 Blacks in Law Enforcement.

“We're not going to recover as a city if we turn back time and see an increase in violence, particularly gun violence,” Adams said at a Times Square campaign event after Saturday's shooting.

It remains to be seen whether Adams' message resonates in a city that was convulsed by Black Lives Matter protests following last year's murder of George Floyd by Minneapolis police but is fearful of crime and disorder after a year of lockdown.

The biggest twist in the race has involved a misconduct allegation against Stringer, who has held elective office since 1993 as a state Assembly member, Manhattan borough president and now city comptroller.

Stringer, 61, appeared to be gaining ground when lobbyist Jean Kim accused him in late April of unwanted groping and sexual advances when she was working on his unsuccessful campaign for public advocate in 2001.

Stringer denied the allegation and said the two had had a brief, consensual relationship.

Elected officials and organizations that had endorsed Stringer rushed to withdraw their backing, though some unions, including the American Federation of Teachers, are sticking with him.

State Sen. Jessica Ramos, a Queens Democrat, said she rescinded her endorsement even though she doesn't know whether Stringer or Kim is telling the truth.

“For me the issue here is that we're talking about an incident that took place 20 years ago that will likely not have any sort of conclusive investigation - certainly not within the time frame of the primary election - and I strongly believe will forever be stuck in a he said-she said,” Ramos said. “To me it's about New Yorkers deserving a mayor that is not distracted or marred by a scandal, especially one of this size.”

For some, the misconduct accusation points to the need for more women in high office. Unlike other American cities such as Chicago, Atlanta, New Orleans or San Francisco, New York City has never elected a female mayor. Nor has New York state had a female governor.

“There's no question it's way over time for a woman mayor, and something like this allegation of sexual harassment as it relates to a candidate only makes you nod your head more aggressively that yes, we need a woman mayor, we need women in high executive positions,” said Christine Quinn, a former City Council speaker who lost in a 2013 Democratic mayoral primary to de Blasio.

None of the women running for mayor in 2021 has cracked the top tier of candidates, with Yang, Adams and Stringer taking the top spots in every poll.

Wiley, a former MSNBC analyst and de Blasio administration lawyer, has sought to brand herself as a champion of women, with endorsements from Gloria Steinem and the feminist political action committee EMILY's List.

Garcia - long lauded as a problem solver in city government - released a TV ad that shows her inside a red box labeled “in case of emergency, break glass.” In the ad, she lists a few of her managerial credentials and says, “When there's a crisis, sometimes you've got to break glass to solve it.” The reference to women breaking the glass ceiling is clear.

New York City mayoral races are often unpredictable. De Blasio vaulted over a large field in the 2013 primary thanks to campaign ads featuring his biracial son, Dante, and former congressman Anthony Weiner's sexting scandal.

Stringer appears committed to staying in the race, with a busy campaign schedule including stops at five churches last Sunday. Some think he still has a chance.

“We know who Scott is, we've seen him for, you know, 30 years as an Assembly member, a borough president, a comptroller. He's established who he is, and now he's gotta go back and defend himself,” said Sid Davidoff, a lawyer and former aide to New York City Mayor John Lindsay.

Yang recently picked up endorsements by Rep. Grace Meng, a Queens Democrat who is the first Asian American to be elected to Congress from New York, and Rep. Ritchie Torres, a Democrat who is the Bronx's first openly gay Congress member. Comedian Dave Chappelle also endorsed Yang this past week.

The winner of the primary will be strongly favored to win the November general election in the overwhelmingly Democratic city, but there will also be a Republican primary featuring Guardian Angels founder Curtis Sliwa and businessman Fernando Mateo.

Voter turnout tends to be low in New York City primaries, so a relatively small number of people could pick the leader who will guide the city out of a once-in-a-century pandemic.

About 700,000 New Yorkers voted in the 2013 primaries, or 20% of registered Democrats and Republicans.