PORTLAND – Michael Brennan has the inside track to become the city’s first popularly elected mayor since 1923, but the city likely won’t declare a winner until late this afternoon.

Brennan, a former state senator, earned 5,240 first-place votes, or 26.7 percent of the total on Tuesday. But Ethan Strimling, another former state senator, earned 4,390 first-place votes, or 22.4 percent, which left him “within striking distance,” he said.

The city will conduct an “instant runoff” election today using voters’ second- and third-place choices — and possibly fourth, fifth and so on — until one candidate has more than 50 percent of the vote.

Late Tuesday night, flanked by green and white balloons and signs, Brennan gave a celebratory yet cautious speech at Empire Dine & Dance on Congress Street.

“I can’t be more pleased at this point with the position we’re in,” Brennan said to raucous applause. “But it’s not the end of the story.”

Strimling and his supporters agreed.

At Havana South on Wharf Street late Tuesday night, where Strimling’s team gathered to celebrate the campaign and await results, the mood was still optimistic.

Strimling noted nearly 10,000 voters didn’t put Brennan or Strimling as their first choice. As those votes are redistributed in the instant runoff election today, Strimling needs to close an 850-vote gap between him and Brennan.

“That’s absolutely doable,” Strimling said. “We like our chances.”

More than 19,500 people castvotes in the mayor’s race, the first of its kind in Portland in 88 years. That total was much higher than the prediction of 12,000 voters forecast last week by the City Clerk’s Office.

City Councilor and incumbent Mayor Nick Mavodones grabbed the third most first-place votes Tuesday with 2,938, or about 15 percent of the vote. Like Strimling, Mavodones also said he was “within striking distance.”

City Councilor David Marshall was in fourth with 1,516 first-place votes, or about 7.7 percent.

With no clear winner yet, the next round of ranked-choice vote counting resumes at 8 a.m. today in the State of Maine Room at City Hall. The public is welcome to watch the proceedings, said Nicole Clegg, the city’s director of communications.

Employees from TrueBallot Inc., a New York consulting firm, will spend most of the morning setting up their equipment and scanning in ballots. The actual count for the second round will begin in the afternoon. Final results are expected by 5 p.m.

As part of the second round, TrueBallot’s software will eliminate candidate Jodie Lapchick, who received the least number of first-place votes with 127.

Everybody who voted Lapchick first will have their ballots redistributed to their second choice. If any candidate still has not reached 50 percent, the process would move to the next round. Hamza Haadoow, the next lowest vote-getter, would be eliminated, and everybody who gave Haadoow their first-place vote would have their ballots redistributed to their second choice.

The process will continue until one candidate has more than 50 percent of the remaining ballots.

If a voter placed Lapchick and Haadoow first and second, their ballot would be redistributed to their third-place choice. The ballots will always be distributed to the voter’s highest-ranked remaining candidate.

On Tuesday night, the city used its own equipment to tally the first-place votes. But today it will need TrueBallot’s equipment to conduct the instant-runoff election.

The city didn’t know if it would need TrueBallot — the race could have ended Tuesday night if one candidate received more than 50 percent — which is why the race will spill over into today, Clegg said. The city didn’t want to purchase TrueBallot’s services for today if it didn’t need them, she said.

The celebration at Empire Dine & Dance certainly felt like a victory party. Brennan’s son, Ryan, 27, played guitar on stage while Sadie Lloyd, a Brennan supporter, belted out tunes.

In his speech, with his wife, Joan, by his side, Brennan said he arrived in Portland 36 years ago with $65 and all his possessions in the back of his $250 car.

“Thirty-six years later, to be standing here … I feel incredibly blessed,” Brennan said. “Portland has been very, very good to me, and I hope over the next four years, if I’m elected, I can be very good to Portland.”

Staff Writer Jason Singer can be reached at 791-6437 or: [email protected]