Two men, one of them wanted for desertion from the military, have been arrested and charged with reckless endangerment and weapons possession in connection with a shooting outside a Smithtown nightclub in June, Suffolk County police announced in a statement released Thursday.

Police said one of the suspects, Joell Nieves, 22, of Illinois Avenue, Bay Shore, surrendered to Fourth Squad detectives on June 24.

The other suspect, who was wanted for desertion, Dashaun Odister, 21, of Munsell Road, East Patchogue, was arrested July 6 by the police Firearms Suppression Team on Montauk Highway in Bellport.

Both were wanted in connection with the shooting of a man outside the Hypnosis 8.0 on East Main Street in Smithtown in the early hours of June 3, police said.

The victim, identified only as a 29-year-old Central Islip man, sustained a non-life-threatening leg injury in the shooting.

Police said he was taken to Stony Brook University Hospital via Smithtown Fire Department Ambulance.

The status of his recovery is unknown.

advertisement | advertise on newsday

Investigators said in the hours after the shooting that initial indications were that the shooting involved club patrons, but that “we don’t have a shooter identified at this time.” Police said in an incident account that “at least two people” fired shots. It was not clear if the victim was targeted.

Police said a patron inside the club damaged a water pipe by hanging on it, causing it to burst, which led to patrons evacuating the club. Police said that once the club was evacuated, an altercation ensued that lead to the shooting. Investigators said at the time that they reviewed video surveillance footage in an attempt to identify suspects.

It was not clear how the two men arrested were identified as suspects.

Police said Nieves was charged with first-degree reckless endangerment and third-degree criminal possession of a weapon. Court records show Nieves was indicted June 30 and pleaded not guilty. He was remanded on $25,000 cash bail or $50,000 bond and is due back in court on Aug. 10.

Odister is charged with first-degree reckless endangerment, second-degree criminal possession of a weapon, third-degree aggravated unlicensed operation of a motor vehicle, police said. Odister also had an active warrant for Military Desertion, police said.

He faces arraignment Thursday in First District Court in Central Islip, police said.