The man who accosted Republican gubernatorial candidate Lee Zeldin at a campaign event in western New York will be released from jail into an alcohol treatment program, a federal judge ruled.

U.S. Magistrate Judge Marian Payson agreed Wednesday to allow David Jakubonis to enter a treatment program administered by the Veterans Administration. He will then be transferred to a halfway house operated by an organization that assists troubled veterans.

The attack on Zeldin, a Congress member from Long Island who is challenging Democratic Gov. Kathy Hochul, occurred July 21 at a campaign rally near Rochester.

ALLEGED LEE ZELDIN ATTEMPTED ATTACKER CHARGED WITH FELONY, IMMEDIATELY RELEASED JUST AS CONGRESSMAN PREDICTED

A video of the incident shows Jakubonis raised his arm toward Zeldin while holding a keychain with two sharp points. "You’re done," Jakubonis said four times as he approached Zeldin.

Attorneys for Jakubonis, an Army veteran, have said their client was drunk and was only reaching for Zeldin’s microphone to stop him from talking.

Lee Zeldin

U.S. Rep. Lee Zeldin, pictured here in New York City, on Oct. 10, 2022, was assaulted by an intoxicated man in the crowd of a campaign event in Long Island, on July 21, 2022. (Photo by Gotham/GC Images)

"Mr. Jakubonis, if he is drinking, does have a problem holding his liquor," defense attorney Steven Slawinski said at a detention hearing, adding that Jakubonis has been prescribed psychiatric medication that can interact poorly with alcohol.

Jakubonis has been jailed since he was charged federally with assaulting a member of Congress with a dangerous weapon. He was initially arrested on a state charge of attempted assault and released.

John DeMarco, an attorney for Jakubonis, said he expects Jakubonis to be released on Monday.

CLICK HERE TO GET THE FOX NEWS APP

A request for comment on the decision to release Jakubonis to an alcohol treatment program was sent to a Zeldin campaign spokesperson.