A male nurse was sentenced Thursday to two years behind bars for having sexual contact with the remains of an 82-year-old woman whose body he had been assigned to prepare for a mortuary.

Judge Thomas Rubinson also ordered Alejandro Razo, 62, of Reseda, to attend sexual offender meetings and weekly psychological counseling during the last 180 days of his term, which will be under supervised release, according to the Los Angeles County District Attorney's Office. Razo also must stay away from Sherman Oaks Hospital, where he was employed at the time of the offense, according to the District Attorney's Office.

Razo was convicted June 26 of sexual contact with human remains. Jurors acquitted him of sexual penetration by a foreign object involving the same victim while she was alive, according to Ricardo Santiago of the District Attorney's Office. Razo -- whose nursing career spanned 20 years at various health care facilities -- was assigned to care for the woman and was tasked with preparing her body for the mortuary after she died of natural causes Jan. 20, 2013.

Soon after, another nurse walked into the room and discovered Razo with his pants down, having sexual contact with the woman's corpse, according to Deputy District Attorney Pamela Revel. Razo was taken into custody after the jury's verdict last week.