Incumbent Democrat Bob Menendez has been elected to a third term, the Associated Press projects.

With 45 percent of precincts reporting as of 10 p.m., Menendez had 53 percent of the vote, compared to Republican challenger Bob Hugin's 45 percent, the AP reported.

Hugin conceded the race just before 10:20 p.m.

The race saw Menendez fighting a pitched battle against Hugin, in an unexpectedly close contest that threatened to upset the Democratic party's half-century hold on the seat. Polls wavered — with the William Hughes Center for Public Policy at Stockton University at one point showing the two candidates in a dead heat.

Menendez said Tuesday night he was "so proud that New Jerseyans rejected the politics of personal destruction and the false, negative salacious ads" from the Hugin campaign.

Hugin had given his campaign more than $36 million to keep the fierce battle going. He seized on Menendez's 2017 federal trial, which ended with corruption charges being dropped, but also led to a harshly worded Senate Ethics Committee admonishment.

Menendez tried to link Hugin to President Donald Trump, highlighting past contributions to him, and arguing Hugin would rubber-stamp Trump initiatives. Hugin had promised to be an independent voice throughout.

Republicans haven’t won a Senate race in New Jersey since 1972, but as polls tightened and Hugin’s financial advantage piled up, analysts at the Cook Political Report shifted their rating of New Jersey’s Senate race to a toss-up on Oct. 26. Other analysts had said Menendez remained favored — but polls never showed and clear preference for Hugin.

Even so, the last four public polls of the race showed a growing lead for Menendez of 8 points to 15 points.

The final Quinnipiac University poll, released Monday, found Menendez with his largest lead since the spring, 15 points, at 55 percent to 40 percent.

Final results were not yet available Tuesday night, with several counties yet to report and many of nearly 600,000 mail-in ballots still out.

“This is a blue state where there are more Democrats than Republicans, and indications are that voters want to keep this Senate seat in New Jersey in the ‘D’ column,” Polling analyst Mary Snow told New Jersey 101.5.

The vitriolic race and Menedez's own troubled past led the Star-Ledger, the state's largest newspaper, to offer only the most disdainful endorsement, telling voters "Choke it down, and vote for Menendez."

"Both candidates are slippery characters, even by Washington standards," the paper argued. It called Menendez's choice to stay in the race even after his trial "an act of profound narcissism," but argued he'd fight for New Jersey's interests and provide a check against Trump.

— With Associated Press reports, and prior reporting by Michael Symons