NEW YORK (AP) — U.S. Rep. Dan Donovan singled out President Donald Trump's support as key to his fending off a tough Republican primary challenge Tuesday from Michael Grimm, a former congressman who appeared on the verge of a political comeback 3½ years after resigning to serve prison time for tax fraud.

Donovan, New York City's only Republican congressman, told supporters at a ballroom on the Staten Island waterfront that Trump had "stuck his neck out" with his endorsement late last month and that voters should return the favor by thwarting a Democratic majority and efforts to impeach the president.

"We cannot let that happen," Donovan said.

Trump congratulated Donovan in a tweet about an hour after the polls closed, calling it a "tremendous win" and saying that the incumbent had "showed great courage in a tough race!"

In a tweeted endorsement on May 30, Trump warned that a vote for Grimm risked handing the seat to Democrats. At least one independent poll had showed Grimm leading the race at the time.

Trump's son, Donald Jr., recorded a phone call to voters on Monday. His daughter-in-law, Lara Trump, recorded a video for Donovan. His lawyer, Rudy Giuliani, appeared with Donovan at a campaign rally on June 16.

Donovan faces Democratic primary winner Max Rose in the Nov. 6 general election to represent New York's 11th Congressional District, which covers Staten Island and part of Brooklyn

"This is only half over," Donovan said. "We have our work cut out. We need to keep this seat."

Grimm conceded and congratulated Donovan soon after the polls closed. He told supporters at a Hilton Garden Inn on Staten Island that it was "extremely important" to back the incumbent and keep the seat Republican.

Grimm also suggested that he'd be heard from again.

"Don't worry," the former Marine and FBI agent told supporters. "This is just the beginning for Michael Grimm."

A victory would have been a remarkable comeback for Grimm, who resigned his seat and spent more than seven months in a federal prison after pleading guilty in 2014 to cheating the government out of income and payroll taxes and knowingly hiring immigrants in the country without legal authorization to work at his Manhattan restaurant.

In a bitter and bruising primary campaign, Grimm was unapologetic over his conviction. He claimed that tax abuses among restaurant owners were common and his prosecution was politically motivated.

Grimm assailed Donovan as a lightweight who hasn't done enough for his constituents and accused the former district attorney of offering to help him get a presidential pardon if he dropped out of the race. Donovan said that story is a lie.

Donovan defended his record and urged voters not to trust Grimm. He also tilted his politics rightward for the primary and cast himself as a loyal soldier for Trump, despite having been one of the few Republicans to vote against the tax reform bill that the president counts among his most important achievements.

Trump, who carried Staten Island in the presidential election and remains popular there, had said in a tweet that Donovan could win in November "and his opponent will not."

"We can't take any chances on losing to a Nancy Pelosi controlled Democrat!" Trump had said.

Grimm was also dogged with questions about his temperament. Before his prison term, he was best known for having once threatened, on camera, to throw a television reporter off a balcony at the U.S. Capitol.

Rose, a decorated Army veteran wounded in Afghanistan, emerged from a six-way Democratic primary. He has already raised more than $1 million in anticipation of going on to the general election.

Rose has a master's degree in philosophy and public policy from the London School of Economics. He hasn't previously held elected office.

Staten Island, a conservative corner of liberal New York City, last elected a Democrat to Congress in 2008. U.S. Rep. Michael McMahon served one term before he was ousted by Grimm in the 2010 election.

___

Follow Sisak at twitter.com/mikesisak

Copyright 2018 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.