NEW YORK — Thirteen Democrats and two Republicans engaged in a last effort to rally supporters Tuesday as voters cast their ballots in New York City’s mayoral primary, the first citywide election to use ranked choice voting.

Several candidates in the race to succeed Mayor Bill de Blasio have the potential to make history if elected. The city could get its first female mayor, its first Asian American mayor or its second Black mayor, depending on who comes out on top.

But with the debut of the ranked voting system and a mountain of absentee ballots still at least a week away from being counted, it could be July before a winner emerges in the Democratic contest.

Brooklyn Borough President Eric Adams, a former police captain who co-founded a leadership group for Black officers, has led in several recent polls. But he’s been closely trailed by former city sanitation commissioner Kathryn Garcia and former de Blasio administration lawyer Maya Wiley, with former presidential candidate Andrew Yang also in pursuit.

“This has been an amazing journey,” Adams told reporters after voting in Brooklyn, emotionally recounting how his path into both law enforcement and politics began at age 15, when he was beaten by police officers. “A little boy, laying on the floor of the 103rd Precinct, assaulted by cops, now could become the mayor to be in charge of that same police department.”

The ranked choice system, approved for use in New York City primaries and special elections by referendum in 2019, lets voters rank up to five candidates on their ballot.

Vote tabulation is then done in computerized rounds, with the person in last place getting eliminated each round, and ballots cast for that person getting redistributed to the surviving candidates based on voter rankings. That process continues until only two candidates are left. The one with the most votes wins.

It won’t be until June 29 that the Board of Elections performs a tally of those votes using the new system. It won’t include any absentee ballots in its analysis until July 6, making any count before then potentially unreliable.

More than 87,000 absentee ballots had been received by the city as of Monday, with thousands more expected to arrive in the mail over the next few days.

Besides Adams, Garcia, Wiley and Yang, other contenders in the Democratic contest include City Comptroller Scott Stringer, former U.S. Secretary of Housing and Urban Development Shaun Donovan, former Citigroup executive Ray McGuire and nonprofit executive Dianne Morales.

De Blasio, a Democrat, leaves office at the end of the year due to term limits.

In the Republican primary, Guardian Angels founder Curtis Sliwa faced off against businessman Fernando Mateo.

Because there are only two candidates in that race, ranked choice voting won’t be a factor.