A man being held for shoplifting by Bayonne Walmart security officers attempted a bizarre escape through a crawl space in the ceiling, but he was quickly caught by Bayonne police, authorities said.

Matthew Ricciardi, 27, of Jackson Street in Hoboken, was charged with making terroristic threats, robbery, criminal mischief, resisting arrest, possession of drug paraphernalia and possession of a hypodermic syringe, Bayonne police Lt. Eric Amato said.

The incident occurred just after 6 a.m. Tuesday at the 24-hour store, Amato said. Bayonne police responded to a report of a fight and a loss prevention officer told them that Ricciardi was detained after he seen shoplifting, Amato said.

Inside an office to be processed, Ricciardi threatened the staff and assaulted workers in an attempt to flee, Amato said.

Unable to escape through the office door, Ricciardi climbed on a desk and climbed into the crawl space between the ceiling and the roof. Officers pinpointed his location and apprehended Ricciardi, Amato said.

During a search after the arrest, a Bayonne police officer was stuck by a hypodermic syringe in Ricciardi’s pants. A further search led to the recovery of two glassine packets used to package drugs. The officer was treated for his injury and Ricciardi was also treated at the Bayonne Medical Center for minor injuries sustained during the incident.