Update: Read our live coverage of the New Jersey governor’s race

ASBURY PARK, N.J. — New Jersey’s Democratic governor, Phil Murphy, was locked in a tight election battle with his Republican opponent, Jack Ciattarelli, early Wednesday after Ciattarelli mounted an unexpectedly strong challenge to the incumbent governor.

With 88% of the expected vote counted from Tuesday’s election, the Associated Press projected Ciattarelli with a lead of less than 1,200 votes out of more than 2.3 million cast.

Murphy took the stage at about 12:30 a.m. at his campaign’s Election Night party here and acknowledged that there could be no celebrating yet. He and his supporters departed the headquarters without knowing who had won.

“We’re going to wait for every vote to be counted,” he said. “And that’s how our democracy works.”

A few minutes later, Ciattarelli spoke to his supporters in Bridgewater, in Somerset County, predicting that “sometime real soon” he would be able to declare victory.

“Although it was not my intention, we have sent the message to the entire country,” he said. “Every single time it’s gone too far off track, the people of this state have pushed and pulled and prodded right back to where it needs to be.”

Despite a host of preelection polls showing Murphy with a comfortable lead, Ciattarelli pulled ahead in the count Tuesday night, doing so in a state with more than one million more registered Democrats than Republicans.

Murphy, 64, campaigned for reelection on his record, saying another term would mean building on progressive accomplishments made in his first four years. He set off to break the decades-old pattern under which Democratic governors have not been able to win reelection in New Jersey.

But Ciattarelli, 59, ran a tireless race. He stopped short of fully embracing former President Donald Trump, but tried not to alienate Trump’s hard-core supporters in the Garden State. A former assemblyman from Somerset County with a record as a GOP moderate, Ciattarelli homed in on taxes, a perennial sore spot in New Jersey, and also said that Murphy’s pandemic response had been too extreme.

» READ MORE: Republican Jack Ciattarelli is looking to become N.J. governor by reaching moderates without losing the Trump base

After almost two years of campaigning, Ciattarelli appeared to be gaining ground in recent weeks. A poll last week found that after months in which voters listed COVID-19 as a top concern, they began citing taxes, schools, and the economy as key issues.

Murphy was surely hurt, too, by electoral dissatisfaction with President Joe Biden, the same trend that fueled Glenn Youngkin, the Republican nominee for governor of Virginia, as he defeated former Virginia Gov. Terry McAuliffe in the nation’s only other gubernatorial fight. In the final days of the New Jersey contest, a poll showed that only 43% of the state’s voters approved of Biden’s job performance, a lower ranking than what they gave Murphy.

At the Murphy event Tuesday, Lt. Gov. Sheila Oliver appeared earlier to reassure a crowd that appeared increasingly anxious.

”We know that there are many, many votes still waiting to be counted. We know that,” said Oliver, a former assemblywoman from Essex County. “And in some of our key Democratic strongholds, we’ve got thousands and thousands of votes. ... We are ready for a marathon.”

In the campaign, Murphy made appearances with numerous top party leaders to get out the vote, including Biden, Barack Obama, and Sen. Bernie Sanders. Still, some saw an enthusiasm gap as the election approached.

Murphy was hoping to be the first Democratic governor to win a second term since 1977. His candidacy seemed to be buoyed by demographic changes in New Jersey, with census figures showing the state growing more diverse. Biden took more than 57% of the vote in last year’s election.

Moreover, many of Murphy’s policies and legislative achievements have been popular. One early poll found Murphy had as much as a 16-point advantage, though that narrowed in recent weeks.

As McAuliffe had in Virginia, Murphy tried to tie his opponent to Trump, seeking to capitalize, for instance, on Ciattarelli’ s appearance at a “Stop the Steal” rally last year.

» READ MORE: Republican Jack Ciattarelli is looking to become N.J. governor by reaching moderates without losing the Trump base

A former Wall Street banker with little political experience, Murphy was elected in 2017 after campaigning on an unabashedly progressive platform, casting himself as a mild-mannered antidote to the Christie era. In his four years in office, he delivered on many campaign pledges, including hiking the minimum wage to $15, a paid sick-leave law, legalizing recreational marijuana, and imposing a millionaire’s tax.

Murphy also drew broad support for his pandemic response, with polls finding that many residents approve of how he’s handled guidelines like masking and the rollout of the coronavirus vaccines. His regular coronavirus briefings were watched by thousands and boosted his profile among residents who might not have known much about him previously.

The last Democratic governor to win a second term was Brendan Byrne in 1977. In 1993, Gov. Jim Florio lost reelection, facing anger as a result of steep first-term tax hikes. Gov. Jim McGreevey resigned in scandal in 2004, three years into his first term.

Democrat Jon Corzine, who ran for reelection in a recession, lost in 2009 to Christie. Like Murphy, Corzine had worked for the Goldman Sachs financial firm. It was unclear early Wednesday whether Murphy would also follow in Corzine’s footsteps by failing to win reelection.

Staff writer Laura McCrystal contributed to this article.