An Islip man was arrested Tuesday, charged with firing a handgun inside a Deer Park nightclub earlier this month — then committing an armed robbery in the club parking lot, police said.

Suffolk County police said the crimes happened on Sept. 2 at Illusions Gentleman’s Club on Saxwood Street.

The club has been the scene of several shootings in recent years, including a fatal shooting in the parking lot in 2014 and another in which two patrons were grazed by bullets in 2015. On Sept. 27, 2014, Ryan Aguilar, 20, of Wyandanch, was shot and killed during a fight in the club parking lot, authorities said. In the 2015 shooting, two Brentwood men were hit by gunfire — one in the neck, the other in the upper leg.

Police said Richard McFarlane, 23, of Sunrise Highway, was arrested in the recent shooting and robbery. At about 3:30 a.m. Sept. 2, police said, McFarlane fired a handgun inside the crowded nightclub during a dispute, “narrowly” missing patrons and employees — a bullet striking the rear wall. Then, police said, McFarlane was involved in an armed robbery in the parking lot.

advertisement | advertise on newsday

The incidents followed “an altercation” at the club involving McFarlane, police said. Police did not release details of that altercation. It also was not immediately clear what evidence led investigators to arrest McFarlane — or if a gun was recovered.

Police ask anyone with information about the crimes to call First Squad detectives at 631-854-8152.

McFarlane was charged with first-degree reckless endangerment and first-degree robbery. He faces arraignment Wednesday in First District Court in Central Islip.