The victory over Jack Ciattarelli, which ended Democrats’ 44-year re-election losing streak in the state, was far tighter than polls had predicted.
Philip D. Murphy, a New Jersey Democrat whose aggressive approach to controlling the pandemic became a focal point of the bid to unseat him, narrowly held onto the governor’s office in an unexpectedly close election that highlighted stark divisions over mask and vaccine mandates, even in a liberal-leaning state.
With roughly 90 percent of the vote tallied, Mr. Murphy was ahead of his Republican challenger, Jack Ciattarelli, by less than 1 percentage point when The Associated Press called the race just before 6:30 p.m. on Wednesday after a protracted count. The bulk of the outstanding votes were in Democratic strongholds.
For Democrats who had long assumed Mr. Murphy’s victory was assured even as the national electoral picture darkened, the 24 hours after polls closed proved tense: Mr. Ciattarelli at one point held a substantial lead.
Every public opinion poll throughout the campaign had showed that Mr. Murphy would coast to an easy victory. But Mr. Ciattarelli hammered away at the state’s high taxes and polarizing issues such as whether schools should teach about systemic racism, and he repeatedly asserted that Mr. Murphy’s tough Covid rules were undermining personal liberty.
Democratic strategists began whispering about a vague sense of anxiety that only intensified after rank-and-file Republicans turned out in force to the second debate in South Jersey in mid-October.
Mr. Murphy’s narrow victory — and a key loss in the Virginia governor’s race — were widely interpreted as ominous signs for Democrats, potentially signaling voters’ dismay with President Biden, fears about the economy and pushback on cultural issues that were central to some G.O.P. campaigns.
Still, a win by any margin was considered a significant milestone. Mr. Murphy, a wealthy former Goldman Sachs executive, is the first Democrat in more than four decades to be re-elected in the largely suburban state.
“You know, we just had the most ‘New Jersey’ experience,” Mr. Murphy said, joking about his protracted victory during a speech to supporters in Asbury Park late Wednesday night. “I was on my way someplace, and it took us longer to get there than we planned.”
At the end of the contentious race, Mr. Murphy sounded a conciliatory note.
“If you want to be governor of all of New Jersey, you must listen to all of New Jersey. And New Jersey, I hear you,” Mr. Murphy said.
Mr. Ciattarelli did not immediately concede, and a spokeswoman wrote on Twitter that it was “irresponsible” to declare a winner in the close race.
Mr. Murphy, 64, had campaigned largely on his first-term record and his unabashedly left-leaning approach to governing a state where there are nearly 1.1 million more registered Democrats than Republicans.
The pandemic, which has killed about 28,000 residents, hobbled much of the region’s economy and disrupted the education of 1.3 million public school students, persisted as the campaign’s defining issue.
Mr. Murphy used executive orders to enforce some of the country’s strictest rules to curb the spread of the virus. Just before Memorial Day he was one of the last governors to repeal an indoor mask mandate. As new cases of the highly contagious Delta variant spiked during the summer, he was among the first to require teachers to be vaccinated or submit to regular testing.
But Mr. Ciattarelli, a former assemblyman, made Mr. Murphy’s edicts a centerpiece of his campaign, using ads and stump speeches to attack vaccine mandates and mandatory masking in schools, and blaming Mr. Murphy’s lockdown orders for hurting small businesses and keeping students out of school for too long.
Lindsey Laverty, 31, said it was Mr. Murphy’s mask and vaccine mandates that made her vote against him.
“We need to get back to freedom and choice,” she said Wednesday in Somerville, N.J.
The pandemic was by no means the only issue. Mr. Ciattarelli drove home a Wall Street-versus-Main Street theme and homed in on a 2019 comment by Mr. Murphy about taxes. “If you’re a one-issue voter and tax rate is your issue, either a family or a business — if that’s the only basis upon which you’re going to make a decision,” Mr. Murphy said, “we’re probably not your state.”
Mr. Ciattarelli’s campaign plastered parts of the comment across billboards, on Facebook and in television ads all over the state.
Mr. Murphy appeared to significantly underperform President Biden’s 2020 showing in highly educated suburban counties that had favored Democrats in the Trump era — the kind of counties that were central to the Democratic takeover of the House in 2018, including in New Jersey.
“What’s changed in recent weeks is that President Biden’s approvals have taken a hit as the national mood has shifted,” said Michael Soliman, a veteran of New Jersey Democratic politics, referencing Mr. Biden’s weak poll numbers. He said Democrats — both progressive, like Mr. Murphy, and more conservative, like Steve Sweeney, the Democratic leader of the State Senate, who was still locked in a close race on Wednesday — were feeling the effect of that shifting national playing field.
Michael DuHaime, who was the lead strategist for the Republican former Gov. Chris Christie’s victories in 2009 and 2013, said former President Donald J. Trump’s absence from the ballot returned some voters to the G.O.P. fold.
“They didn’t like Donald Trump. It’s pretty simple. It wasn’t some endorsement to go far left,” Mr. DuHaime said.
At campaign stops over the last week, Mr. Ciattarelli displayed a Boston Bruins jersey emblazoned with Mr. Murphy’s name as he reminded supporters of the governor’s Massachusetts roots and his white-shoe investment banking pedigree.
In the end, more voters appeared to support the approach taken by Mr. Murphy, who in his first term established New Jersey as one of the most progressive states in the nation.
Over the last four years, he locked in a deal to gradually increase the minimum wage to $15, raised the tax rate on income over $1 million and legalized marijuana. He made community college free for students in households with incomes of less than $65,000, restored voting rights to people on probation or parole, and authorized drivers’ licenses for undocumented immigrants.
Results trickled in slowly after polls closed Tuesday at 8 p.m. from Democratic strongholds like Essex and Camden Counties, skewing the early totals and making it clear that the race would be far tighter than expected.
Central to the delay in calling the race was the number of outstanding mail and provisional ballots.
New Jersey did not permit local election officials to begin “preprocessing” ballots this year until Election Day, causing a backlog of more than 520,000 mail ballots to be counted in a single day.
New voting equipment used to enable voters to cast ballots early, in person, also caused confusion; in some cases, voters had to use emergency provisional ballots to cast their votes — adding to the volume of ballots to tally.
All 120 legislative seats were also on the ballot. Democrats were expected to retain control of Trenton, but did appear to be on track to lose several seats — including one held by Mr. Sweeney.
Takeaways From the 2021 Elections
A G.O.P. pathway in Virginia. The win by Glenn Youngkin, who campaigned heavily in the governor’s race on education and who evaded the shadow of Donald Trump, could serve as a blueprint for Republicans in the midterms.
He has often been able to bend the entire Legislature to his will, but he was trailing in his race against an unknown Republican candidate, Edward Durr, whose campaign spent just $153. The race remained too close to call on Wednesday.
Mr. Murphy will start his second term facing pronounced challenges. New Jersey’s unemployment rate of roughly 7 percent is one of the nation’s highest, and school districts are only now beginning to assess the pandemic’s true toll on learning, particularly in the state’s large cities, where many schools were closed for more than a year.
“We have come a long way,” Mr. Murphy said at a campaign stop Tuesday in Newark. “But our work is not done. We have to keep moving forward.”
The governor has promised to continue trying to codify abortion rights in New Jersey should federal protections be altered and to strengthen the state’s already stringent gun laws. Neither effort has gained traction in the Legislature, where moderate Democrats continue to hold sway, reflecting some of the rifts in the party as a whole.
By securing a second term, Mr. Murphy shattered a 44-year losing streak in New Jersey, where voters had not re-elected a Democratic governor since 1977, when Brendan Byrne won a second term.
Supporters said that his victory was what mattered. “A second-term governor is called a governor,” said Sue Altman, the leader of the left-leaning Working Families Alliance who has worked closely with Mr. Murphy on key legislation. “It doesn’t matter by how many points.”
During his campaign, Mr. Murphy flexed the power of incumbency, appearing side-by-side with a stream of Democratic luminaries, including Mr. Biden, Senator Bernie Sanders of Vermont and former President Barack Obama. Mr. Ciattarelli stumped at veterans halls and diners, highlighting issues like high taxes and the extraordinary Covid-19 death rate in New Jersey nursing homes.
“Phil Murphy killed 8,000+ grandparents,” stark black-and-white campaign signs planted along roadways stated, without mentioning Mr. Ciattarelli’s name.
But throughout the race Mr. Ciattarelli also struck chords likely to resonate most with voters who supported Mr. Trump.
He opposed most abortions after 20 weeks, and said parents should be notified if their underage daughter seeks to end a pregnancy. He appeared among Trump supporters at a “stop the steal” rally and railed against teaching critical race theory, which argues that patterns of racism are ingrained in American institutions, or a curriculum that highlighted L.G.B.T.Q. pioneers.
“We’re not teaching sodomy in sixth grade,” Mr. Ciattarelli told supporters in June.
Four public polls released in the last week alone found that Mr. Murphy had maintained a comfortable lead in New Jersey.
But as Election Day drew nearer, the ghost of 2009 began to haunt conversations.
Strategists recalled the Democratic loss in Virginia that year and Mr. Christie’s victory over then-Gov. Jon Corzine — both of which were seen as precursors to the 2010 midterm rout, which Mr. Obama memorably called a “shellacking.”
At a Thursday night get-out-the-vote rally with Mr. Murphy at Rutgers University, Senator Sanders warned an enthusiastic crowd of students that turnout was likely to be low — and that every vote mattered.
LeRoy J. Jones Jr., chairman of New Jersey’s Democratic State Committee, said that inertia in Washington had played a role in the close vote.
“The paralysis in Washington has worked its way here in New Jersey,” Mr. Jones said. “The dysfunction has caused people to take pause.”
Chris Russell, a strategist for the Ciattarelli campaign, said that Mr. Ciattarelli had injected “new life” into the Republican Party.
“A lot of things have changed. The entire Democratic power structure has changed,” Mr. Russell said.
“And the upside for the Republican Party in the state is it’s got new life breathed into it,” he added. “And that’s a testament to Jack Ciattarelli.”
Kevin Armstrong, Nate Schweber and Lauren Hard contributed reporting.