Eric Adam secured his place as the Democratic candidate in the race for New York City mayor Tuesday, winning the Democratic primary.

Adams -- who if elected would only be the second Black mayor of the Big Apple -- beat out presidential hopeful turned-mayoral candidate Andrew Yang, Maya Wiley, who was endorsed by New York Democrat Rep. Alexandria Ocasio-Cortez, and top contender Kathryn Garcia.

The Associated Press declared Adams the winner early Tuesday evening based on the latest tabulations, which included most absentee ballots.

REVISED VOTE COUNT AGAIN SHOWS TIGHT NYC MAYORAL RACE FOLLOWING TUESDAY'S TALLY TUMULT

The former police captain ran a different race from his fellow Democratic candidates as a moderate and campaigned on opposing the "defund the police" movement. 

"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 following the May shooting of three people, including a 4-year-old girl, in Times Square. 

Adams frequently referenced his dual identity and how it shaped his platform for policing in the U.S. during his time on the campaign trail 

The 22-year police veteran reportedly suffered his share of police brutality as a Black teenager when he was beaten at the age of 15. 

AOC ENDORSES PROGRESSIVE MAYA WILEY IN NEW YORK CITY MAYORAL CONTEST

Adams then became a police officer in 1984 and rose to become a captain before leaving the force to run for the state Senate in 2006.

But while in the police force, he helped launch a group that pushed for criminal justice reform and countered racial profiling, known as "100 Blacks in Law Enforcement Who Care."

"If Black lives really matter, it can't only be against police abuse," Adams told his supporters the night of the primary race. "It has to be against the violence that's ripping apart our communities."

Adams will face off with Republican candidate Curtis Sliwa in the final race for New York City’s mayoral seat. 

CLICK HERE TO GET THE FOX NEWS APP

But given the heavily Democratic voter base in New York City -- with Democrats outvoting Republicans by seven to one -- Adams’ win appears likely.

Current New York City Mayor Bill de Blasio is unable to seek a third term according to the city charter. 

The Associated Press contributed to this report.