A Kerhonkson man went to an Ulster County hospital emergency room looking for pain medication, according to state police, before he brandished and fired a handgun, setting the stage for a manhunt that eventually ended in New York City.

Troopers said Joshua Stuart went to Ellenville Regional Hospital around 4 a.m. Friday, stricken with abdominal pain. After becoming impatient, troopers said Stuart took out a 9mm and fired, after which he was given medication and then left.

Later on, troopers said Stuart was approached by Department of Environmental Protection police in Napanoch, where shots were exchanged. After running off without his truck, state police said Stuart stole a car and left the area.

According to state police, Stuart then held up a clerk at a Brooklyn bodega before his eventual arrest behind a Whole Foods.

Troopers described him as having a criminal history, but nothing approaching this.

"Joshua Stuart is a troubled man throughout his whole life for 42 years, and has kind of graduated from these petty offenses to now firing on nurses, or medical staff in the emergency room, or police officers," said Capt. Michael Drake, New York State Police, "and thank God I said for everybody's assistance, because now he's in custody and he's away from harming the public."

Stewart remained held in New York City before his eventual extradition back to Ulster County.