The conviction of a former New York City jail guard by a jury that found he ignored the pleas of a dying inmate in 2012 was upheld Thursday on appeal.

The 2nd U.S. Circuit Court of Appeals found no major errors in the December 2014 trial and conviction on civil rights charges of ex-Department of Correction Captain Terrence Pendergrass. It also upheld his five-year prison term.

The former guard is due for release from a low-security federal lockup in Michigan in December 2019.

Pendergrass was convicted of depriving 25-year-old Jason Echevarria of his civil rights in a mental health unit of Rikers Island.

The inmate's death after he swallowed toxic detergent was among a rash of inmate beatings, guard corruption and mistreatment of the mentally ill that drew scrutiny of the nation's second-largest jail system and forced reforms. Riker's houses about 9,000 inmates at 10 facilities.

The push for changes at Rikers began in 2014 after reports by The Associated Press on dozens of deaths there that highlighted poor supervision, questionable medical care and failure to prevent suicides. Violence has continued at Rikers despite tens of millions of dollars spent recruiting and training new guards and the appointment of a reform-minded commissioner who has reduced the use of solitary confinement.

An attorney for Pendergrass declined comment.

When she sentenced Pendergrass last June, U.S. District Judge Ronnie Abrams went above the roughly two-year prison term called for by federal sentencing guidelines, saying criminal indifference of the kind Pendergrass displayed will not be tolerated. She also noted the difficulty of prosecuting civil rights cases.

Prosecutors said Pendergrass told other jail employees he didn't want to be bothered unless there was a "dead body" in the cell after Echevarria told two other correction officers he swallowed the deadly substance.

A defense lawyer prior to sentencing argued that Pendergrass had no reason to accept reports that Echevarria had swallowed a soap ball since it was without precedent that an inmate would receive an unauthorized soap ball and ingest it.

Last year, the family of Echevarria settled a civil lawsuit against the city for $3.8 million.