A doctor who once worked at the prestigious Phillips Academy and also at Children’s Hospital pleaded guilty this morning in federal court to possession of child pornography.

Richard Keller, 57, of Andover could face six years in prison on a total of three charges of receiving and possessing child pornography. The charges of receiving child pornography require a five-year minimum mandatory sentence. He is to be sentenced on Feb. 27.

Keller had pictures and videos of boys from ages 7 to 16 engaged in sexually explicit conduct, and he had some of it shipped to him at the student health center at Phillips. He resigned from Phillips after school officials said they would not renew his contract.

Advertisement - Continue Reading Below

John Palfrey, head of school, said in an e-mail to students and parents after Keller’s arrest in September 2012, that the decision not to renew Keller’s contract was based on professional misconduct unrelated to the federal case.

Palfrey said in the e-mail that Keller had been reprimanded in 1999 for using a school computer to access adult pornography and had shown an inappropriate cartoon to students in 2002.

Keller also worked as a pediatric endocrinologist at Children’s Hospital in Boston and taught at Harvard Medical School. He voluntarily surrendered his state medical license after his arrest.