TRENTON, N.J. — The legacy of Donald Trump’s casino empire disappeared from Atlantic City with last week’s closing of the Trump Taj Mahal, but donations he made years ago are factoring into a New Jersey congressional race.

Incumbent Republican Rep. Frank LoBiondo received donations from Trump more often than any other current member of Congress over a 10-year span ending with his final donation in 2007.

LoBiondo’s Democratic challenger, Dave Cole, is pressing the Trump connection at a time when the Republican presidential nominee is under fire for sexually aggressive comments he made in 2005 and as women come forward to say they were the targets of unwanted sexual advances.

It also comes after Trump himself said while campaigning in 2015 that his donations gained him access to lawmakers. “When I need something from them, I call them,” he said. “They are there for me.”

LoBiondo dismisses the connection, saying donations were given “a long time ago” and people want to hear about solutions to problems now.

The congressman said last week he will not vote for Trump for president and instead write in Mike Pence, Trump’s running mate.

“I have repeatedly and strongly spoken out against Mr. Trump when he degrades and insults women, minority groups and Gold Star military families,” LoBiondo said. “I will not vote for a candidate who boasts of sexual assault. It is my conclusion that Mr. Trump is unfit to be president.”

Trump’s Atlantic City casinos took in tons of money, but they took on so much debt that it led to four bankruptcies under his watch and another after he was gone. Trump lost the last of his stake in the casinos in 2009.

The issue of Trump’s donations has been part of Cole’s campaign from the start, but the race is heading into its final weeks, with LoBiondo buying television ads in the Philadelphia media market, while Republicans in New Jersey and across the country abandon Trump at quick clip.

Cole, a software engineer who worked at a startup called Mapbox, hasn’t claimed any wrongdoing on LoBiondo’s part, but is hammering the connection.

“Frank LoBiondo and Donald Trump have a 25-year working relationship,” Cole said. “I find it unimaginable that he stood by Trump so long, even throughout his casino bankruptcies and the economic devastation he caused in South Jersey.”

New Jersey Gov. Chris Christie, Trump’s transition team chairman and adviser, called the 2005 comments indefensible but is still supporting Trump. Republican Rep. Scott Garrett, who is in the state’s closest re-election fight, said that Pence would be better than Trump but then reiterated through a spokesman that he is still voting for Trump.

In southern New Jersey’s 2nd District race, the contest could boil down to how harmful Trump proves to be for LoBiondo.

“Trump is toxic,” said Fairleigh Dickinson University political science professor Peter Woolley. “He’s toxic to the people who are angry about the demise of Atlantic City and of course he’s toxic to Democrats, especially (Hillary Clinton) Democrats who are going to be out in force.”

Still, LoBiondo is in strong shape as he runs for a 12th term.

He has nearly $1 million compared to Cole’s $15,000 and he has won re-election by comfortable margins every year since he was first elected in 1994. Political forecasters list his district as solidly Republican.

LoBiondo isn’t the only member of Congress who received donations over the years from Trump, who has contributed about $9.3 million to candidate committees since 1997, according to a review of federal data. He has donated to both parties, including to Hillary Clinton during her terms as a U.S. senator in 2002 and 2005.

Trump has contributed to LoBiondo more times than to any other current member of Congress, according to an AP review of Federal Election Commission reports. Other members of Congress have gotten more cash from Trump.

Among the highest-dollar recipients were Majority Leader Mitch McConnell, Minority Leader Harry Reid, New York Democratic Sen. Chuck Schumer and New York Democratic Rep. Charlie Rangel. The donations came across a 16-year period from 1997 to 2013.

Trump donated to 49 current members of Congress, totaling 29 senators and 20 House members. He gave to 39 Republicans compared with 10 Democrats. Trump’s donations have figured in other districts, but have not emerged as a dominant theme among all the members running for re-election.

In Virginia, incumbent Republican Rep. Barbara Comstock said she would refund the $3,000 she got from Trump in 2014. She also said she could not “in good conscience” vote for Trump.