ROME—A former Vatican diplomat to the U.S. was convicted of possessing and distributing child pornography and sentenced to five years’ imprisonment, in the first such trial for that crime in Vatican City.

The conviction of Msgr. Carlo Alberto Capella came on Saturday, only the second day of his trial, bringing the case to an exceptionally swift end by Vatican standards.

The defendant had admitted to the charges in testimony the previous day, while suggesting that a personal crisis at the time of his actions mitigated his guilt.

“My errors are clear, and also clear is the fact that they occurred in a period of fragility,” Msgr. Capella told the court on Saturday. “I hope that this situation might be considered an incident in the course of my life as a priest, which I love more than ever.”

The Vatican said Msgr. Capella would be confined in Vatican City for the duration of his imprisonment. Since his arrest in April, he had been held in a cell in the barracks of the Vatican’s gendarmerie.