Brooklyn Borough President Eric Adams on Wednesday warned other front-runners in the 2021 mayoral race that it’s “going to be a dirty campaign.”

Adams joined two other mayoral hopefuls — City Council Speaker Corey Johnson and Comptroller Scott Stringer — at a lower Manhattan rally promoting the city’s complex new ranked-choice voting system, which goes into effect June 2021.

But while Johnson and Stringer tried to a paint a rosy picture by claiming the new system will rid the Big Apple of mudslinging campaigns, Adams had other thoughts.

“That’s a bit of optimism,” said a stone-faced Adams. “Trust me! Trust me! It’s going to be a dirty campaign.”

Adams failed to clarify his remarks before leaving the rally early, instead using his brief time speaking to reporters to address the need to educate the public on the new rules.

Hours later, Adams’ campaign spokesman Evan Thies claimed the borough president “was joking,” adding, “we are going to focus on the issues.”

Neither Johnson nor Stringer addressed Adams’ comments. Instead, they both insisted after he left that the new rules could help put the kibosh on negative campaigning.

“In other places, typically Candidate X doesn’t want to be critical of Candidate Y because you can turn off Candidate Y’s votes, so instead you have a positive conversation about the issues that are at play,” Johnson said.

“That is what we have seen in Minneapolis, in San Francisco, and other places that have ranked-choice voting.”

Stringer also said he believed the new system opens the door to “positive” campaigning.

“It is inevitable that friends compete, but what I think is critical about ranked-choice [voting] is the way you participate,” Stringer said. “And I think we can all agree that the better we engage as a collective, more people will come out and vote, and more people will feel positive about of democracy.”

“I do think we are going to have better participation and a better debate among candidates,” he added.

But a top Democratic political consultant told The Post he believes Adams’ remarks were spot on, saying: “who doesn’t think it’s going to be a dirty campaign? It’s a mayor’s race.”

Voters overwhelmingly approved the new voting system during a referendum last November. It will allow voters to rank candidates in order of preference on their ballots for city races.

If voters still want to choose just one candidate, they can. A candidate who receives a majority of first choice votes will win.

But if there is no majority winner, the last-place candidate would be eliminated, and any voter who had that candidate as his or her top choice would have that vote transferred to their next choice.

The ranking process continues until a winner is determined.