In the first live televised debate in the Democratic race for mayor, crime and public safety were front and center, while many of the barbs on Thursday night were aimed at the two frontrunners, former presidential candidate Andrew Yang and Brooklyn Borough President Eric Adams.

During one pointed exchange in the debate co-sponsored by NY1, Maya Wiley cited an interview in which Adams referred to stop-and-frisk as a “great tool,” asking, “How can New Yorkers trust you to protect us and to keep us safe from police misconduct?”

“Every time you raise that question,” Adams answered, “it really just shows your failure of understanding of law enforcement.”

When Wiley pointed out she chaired the NYPD Civilian Complaint Review Board, Adams shot back: “We both know how much it was a failure under you,” before suggesting that Wiley was “getting desperate.”

Adams and Yang have been two of the most moderate voices on policing, and on Thursday, Yang again emphasized the importance of the NYPD.

“Let me be clear: Defund the police is the wrong approach for New York City,” Yang said. “You have to start by saying to the police very clearly that you are vital to our city’s recovery.”

On the other end of the spectrum, nonprofit executive Dianne Morales, whose positions skew furthest to the left among the candidates, argued that “safety is not synonymous with policing.”

“The reality of it is that our communities are overpoliced and underresourced,” she said.

Yang, who has thus far dominated media coverage of the race and led most early polls, sustained a few jabs from his opponents but emerged relatively unscathed.

At one point, the debate’s moderator, NY1 political anchor Errol Louis, highlighted some of the candidate’s perceived vulnerabilities.

Yang was asked about his failure to vote in local elections during his more than two decades in New York.

“I would include myself in the approximately 76 percent of registered Democrats who voted in gubernatorial and presidential elections, but have not been involved locally,” he said.

Yang said he’d had a positive impact on the city through less traditional means, like his involvement in January’s Senate runoff elections in Georgia that delivered Senate control to the Democrats.

Adams was asked if primary voters might consider him too conservative, in part because he was endorsed by the New York Post. “Many people are not aware,” Adams said, “but President Obama was also endorsed by the Post.”

And Wiley, a civil rights attorney, was asked about her responsibility for Mayor Bill de Blasio’s missteps during her time in his administration, where she served as counsel to the mayor. “I quit five years ago,” she said. “I voted with my feet in 2016.”

City Comptroller Scott Stringer, meanwhile, again denied sexual misconduct allegations made by a former campaign volunteer. Asked of the possibility of a follow-up investigation, Stringer said: “You have no idea how much I want investigation, resolution and for somebody to listen to the facts.”

Three other candidates in the race have struggled to gain traction and get out of the single digits in early polls: former Obama cabinet member Shaun Donovan, former Citi executive Ray McGuire and former Sanitation Commissioner Kathryn Garcia.

None of the three produced an attention-grabbing moment, though at one point, Donovan took aim at McGuire, describing the Great Recession as “a crisis that you helped create.”

McGuire responded that Donovan was “confused by the facts.”

“He knows I had zero to do with anything that happened in the mortgage crisis,” McGuire said.

As for Garcia, who recently won the endorsement of the New York Times editorial board, she is at least well-regarded by her rivals. When candidates were asked their second choice for the job, Garcia was the only candidate named twice, winning praise from both McGuire and Yang.