He was being eyed as the next City Council speaker — now Councilman Justin Brannan is just trying to hold onto his seat.
The incumbent Brooklyn Democrat found himself part of Tuesday’s red wave along with such national party under-performers as Terry McAuliffe in Virginia and New Jersey Gov. Phil Murphy — an unexpected tight battle to hold onto his seat against a Republic challenger.
Republican Brian Fox leads Brannan by 255 votes in the unofficial machine count — 12,145 votes to 11,890 votes in the 43rd district of Bay Ridge, Dyker Heights, Bath Beach and Bensonhurst.
There were 3,720 absentee ballots sent to voters and 1,456 ballots have been returned, about 70 percent from Democratic voters.
That means Brannan can still pull out a victory — though political sources said his months-long pitch to become speaker takes a serious hit, even if he prevails.
Republicans won at least four other other competitive council races.
“Brannan’s race is closer than people thought. It’s another hurdle for Brannan when it comes to the speakership,” said Queens Councilman Robert Holden.
Another Democratic insider involved in the deliberations said, “No one wants to elect a speaker who is vulnerable.”
Because of redistricting, all 51 council seats are up for election again in two years instead of the typical four years.
But sources close to Brannan said the close race is not a bar to him winning the speakership. It shows that a Democrat can win in a competitive district during a Republican wave election.
Brannan spent more time running for speaker and not taking his re-election race seriously “until it was too late,” said Fox campaign spokesman Bill O’Reilly.
Brannan’s campaign spent just $86,000 on his re-election from July through October — down from $254,000 during the same period in 2017, when he was first elected.
Fox spent $187,000 for the entirety of his campaign.
In 2017, Brannan declared victory on Election Night, ahead of Republican John Quaglione by nearly 900 votes, a tight three-point victory.
Fox was confident his lead would hold.
“When all the absentee ballots are counted, I am confident that my lead in this race will stand. The people of South Brooklyn have spoken, and I’m grateful for their faith in me,” Fox said.
Fox ran tough mailers that sought to link Brannan to the defund the police movement and rapped him for getting slapped with 16 tickets for speeding in school zones, a revelation first exposed by The Post.
Fox, who runs a job recruitment company, also opposed Mayor Bill de Blasio’s coronavirus mandate, which struck a chord with many government workers, including cops and firefighters.
But Brannan said he will prevail when all the votes are counted.
“This campaign was about love over hate, truth over lies, facts over fear, and unity over division, and that’s how I have led as an elected official,” Brannan said in a statement.
“We will need to wait some time for every vote to be counted–but just like in 2020, we are confident that there are enough absentee ballots to prevail once that’s done.”