NEW YORK (AP) — A convicted sex offender who repeatedly used phony correction department credentials to gain entry into New York City jails has been sentenced to 10 years in prison.

Matthew Matagrano was sentenced Thursday. The 36-year-old Yonkers resident pleaded guilty last month to posing as a correction officer and sneaking into the Manhattan Detention Center, where he mingled with inmates for hours.

During a Feb. 27 visit Matagrano assaulted an inmate and stole a $2,500 walkie-talkie. He also handed out cigarettes to inmates.

Matagrano's rap sheet includes a conviction for sodomy and sexual abuse. Police statements released in court report Matagrano said he repeatedly sneaked into jails because the people inside were "nice" and made him "feel important."