GARFIELD — A retired New York City police detective shot and wounded a robbery suspect who is a homeless sex offender with a long criminal history.

Authorities say the retired officer was working in the Tobacco Road store in Garfield on Thursday night with the owner, the owner's wife and son when a man walked in with a handgun and announced it was a robbery.

The retired detective tried to disarm the man and was pushed to the ground. The detective fired one shot and the man fled.

Police located 27-year-old Louis Pizzi, of Hasbrouck Heights, with a gunshot wound to the leg.

Pizzi is held on $500,000 bail, charged with armed robbery and weapons offenses. He is scheduled to make a first appearance in court Monday.

Pizzi served short jail stints in 2011 for aggravated assault with a weapon, in 2012 for various drug and weapons offenses, and in 2013 for Megan's Law sex offender registry violation stemming from a 2003 conviction of raping two girls when he was 14 years old, court records show.

The Associated Press and Sergio Bichao contributed to this report.