Washington CNN  — 

US Rep. Lee Zeldin, the Republican nominee for New York governor, narrowly escaped harm Thursday night after he was attacked onstage at a campaign event.

Zeldin was delivering a speech in Fairport, New York, when a man climbed on stage “and attempted to stab” Zeldin, a statement from the campaign said. The GOP lawmaker “grabbed the attacker’s wrist to stop him until several others assisted in taking the attacker down to the ground,” according to the statement.

The congressman returned to the stage to finish his remarks after the alleged perpetrator was taken into custody, Zeldin’s campaign said.

“Congressman Zeldin, Alison Esposito and all members of Team Zeldin are safe following tonight’s attack,” spokesperson Katie Vincentz tweeted Thursday.

Zeldin posted a still frame from a video shot by WHEC that appears to show the alleged attacker holding an object he tried to use as a weapon.

“His words as he tried to stab me a few hours ago were ‘you’re done’, but several attendees, including @EspositoforNY, quickly jumped into action & tackled the guy,” Zeldin tweeted.

The alleged weapon used in the attack was a “plastic key chain” that is designed for two fingers, resembling the image of a cat’s face, and is intended to be used for self-defense, Monroe County sheriff’s deputy Brendan Hurley said.

A group of people attending Rep. Lee Zeldin's speech gather around an alleged attacker in Fairport, New York, July 21, 2022.

David G. Jakubonis, 43, of Fairport, has been charged with attempted assault in the second degree, the Monroe County Sheriff’s Office said. He was arraigned in town court, and it was not immediately clear if he had an attorney.

On Twitter, Zeldin predicted that his attacker “will likely be instantly released under NY’s laws,” and indeed, Jakubonis was released on his own recognizance.

Bruce Blakeman, the Republican executive of Nassau County, used the attack to criticize efforts to soften criminal penalties.

“There must be real changes to ‘cashless bail’ laws and we must support law enforcement to keep neighbors safe and hold those who endanger the public accountable for their actions,” Blakeman said in a Twitter thread.

Democratic Gov. Kathy Hochul, Zeldin’s opponent in the November gubernatorial contest, tweeted Thursday evening that she was “relieved to hear” he was not injured in the incident.

“My team has informed me about the incident at Lee Zeldin’s campaign event tonight. Relieved to hear that Congressman Zeldin was not injured and that the suspect is in custody. I condemn this violent behavior in the strongest terms possible — it has no place in New York,” Hochul wrote.

Zeldin announced his candidacy for governor last year, tweeting that “the light that was a beacon of what America can be has gone dark.” He clinched the Republican nomination in the race last month.

Zeldin was a vocal defender of former President Donald Trump during his presidency, including publicly defending him during his second impeachment trial. He also echoed Trump’s baseless claims of widespread fraud in the 2020 election and voted against certifying the 2020 election results in Arizona and Pennsylvania.

Zeldin was first elected to Congress in 2014, after serving four years in the New York state Senate.

Hochul, meanwhile, defeated progressive primary challenger and New York City Public Advocate Jumaane Williams, whom she also beat in the 2018 lieutenant governor primary.

CNN’s Samantha Beech and Brynn Gingras contributed to this report.