PORTSMOUTH, R.I. (AP) — A man has pleaded no contest to a charge alleging he impersonated a state social worker while trying to sign out a female student from a Rhode Island high school.

Court records show 26-year-old Armando Hernandez, of Providence, entered the plea Friday to a misdemeanor charge of impersonating a public officer. He received a year of probation.

Portsmouth police Lt. Michael Arnold tells WPRI-TV Hernandez went to Portsmouth High School last Friday and tried to sign the student out, telling a school employee that he was a social worker with the Department of Children, Youth and Families.

The school refused to release the student to him and notified police.

Arnold says Hernandez later admitted he was an Uber driver and that the student had contacted him for a ride.