BOSTON (AP) — A doctor who worked as the medical director of a prestigious Massachusetts boarding school has been sentenced to 6 1/2 years in prison on child pornography charges.

Richard Keller, former medical director at Phillips Academy in Andover, pleaded guilty in November to two counts of receiving and one count of possessing child pornography. In a plea agreement, federal prosecutors and Keller's lawyers had recommended a sentence of between 5 years, 3 months and 6 1/2 years.

Keller tearfully apologized during his sentencing hearing in U.S. District Court on Wednesday.

In the agreement, Keller acknowledged purchasing child pornography from a Canadian company and having some of it sent to the student health center.

Keller also worked as a pediatric endocrinologist at Children's Hospital in Boston and taught at Harvard Medical School.