New Jersey Democrat Bob Menendez was reelected to the U.S. Senate Tuesday, riding anti-Trump enthusiasm to overcome the lingering cloud of his bribery trial and an onslaught of attack ads aired by Republican Bob Hugin.

The Garden State hasn't elected a Republican to the Senate since 1972, but Democratic strategists were bracing for a possible loss, worried that college-educated suburbanites couldn't stomach a vote for Menendez and that urban voters wouldn't go to the polls for a midterm election. Hugin, a former pharmaceutical executive from Summit, loaned his campaign $36 million to make the race competitive.

New Jersey voters' discomfort with President Trump — a theme echoed throughout the campaign — may have proved too big a hurdle for Hugin in a state where registered Democrats outnumber Republicans by 920,000.

With more than 90 percent of the vote in, unofficial projections showed Menendez with a 10-point lead.

"Today is a victory for hope over hate, for facts over fiction, for inclusion over division, for hard work over ripping people off," he told a crowd of supporters in Hoboken, where he was joined by Gov. Murphy. "I am so proud that New Jerseyans rejected the politics of personal destruction and the false, negative salacious ads."

Menendez said that to those who voted for him "in faith, I pledge to honor your faith and not disappoint you." To those who didn't, he said, he'd work to "earn back your respect."

Though Democrats were relieved by the senator's victory, it may have come at a cost. The tight race forced national Democrats to divert resources from key battleground states — like Missouri, Florida, and Indiana — seen as key to their long shot chances of taking the Senate.

Menendez's election to a third term came a year to the month after the senator stood in a courtroom at the federal courthouse in Newark as a judge declared a mistrial in his corruption case, saying the jury was hopelessly deadlocked.

The judge later acquitted Menendez of some of the charges and prosecutors dropped the case. But the federal indictment and evidence presented at trial, plus a bipartisan reprimand handed down by the Senate Ethics Committee, gave Republicans a powerful line of attack for the campaign.

Prosecutors had accused Menendez, 64, of accepting lavish gifts from a Florida doctor, like free trips on a private jet and vacations in the Dominican Republic, in exchange for advancing the doctor's personal and financial interests.

The judge later acquitted Menendez of some of the charges and prosecutors dropped the case. But the federal indictment and evidence presented at trial, plus a bipartisan reprimand handed down by the Senate Ethics Committee, gave Republicans a powerful line of attack for the campaign.

For his part, Menendez depicted Hugin as a Trump Republican and greedy Big Pharma boss who repeatedly raised the price of a cancer drug.

Hugin, 64, who like Menendez is a native of Union City, stepped down as executive chairman of the biotech company Celgene late last year and quickly consolidated GOP support for his Senate candidacy.

He hit the airwaves early with television ads reminding voters of the corruption allegations, and Menendez's standing with voters plummeted in the polls.

A virtually unknown challenger in the June Democratic primary won a remarkable 38 percent of the vote against Menendez — an unmistakable message that even some core supporters were unhappy with the incumbent senator. Some political observers wondered why the party had not supported a more viable candidate.

Menendez barely seemed to try to improve his image with voters, instead using his resources to attack Hugin and argue that the Affordable Care Act's protections for people with preexisting medical conditions and the fate of Social Security and Medicare were at stake in the election.

Hugin served as New Jersey finance chairman for the Trump campaign in 2016 and contributed more than $100,000 to pro-Trump groups. But he presented himself to voters as a centrist with liberal social views, and said during a debate that he was "not a Trump Republican."

Trump himself didn't weigh in on the race until Tuesday afternoon — when he endorsed Hugin on Twitter and wrote, "Get out and Vote for Bob."

In addition to going after Menendez on his ethics problems, Hugin in October aired TV ads that recirculated unsubstantiated allegations that the incumbent had slept with underage prostitutes in the Dominican Republic.

The allegations — first lodged by an anonymous tipster in 2012 — led to an FBI investigation, but the authorities never confirmed them.

By mid-October, Democrats in Washington were getting nervous. Senate Majority PAC, the super PAC aligned with Senate Democratic leader Chuck Schumer of New York, spent $7.6 million on anti-Hugin ads in the expensive Philadelphia and New York media markets.

Menendez might not have needed the help after all. Television networks began calling the election for the senator about a half-hour after polls closed at 8 p.m.