Adalberon died on 23 January 989. Gerbert was a natural candidate for his succession, but King Hugh appointed Arnulf, an illegitimate son of King Lothair, instead. Arnulf was deposed in 991 for alleged treason against Hugh, and Gerbert was elected his successor. There was so much opposition to Gerbert's elevation to the See of Rheims, however, that Pope John XV (985–996) sent a legate to France who temporarily suspended Gerbert from his episcopal office. Gerbert sought to show that this decree was unlawful, but a further synod in 995 declared Arnulf's deposition invalid. Gerbert then became the teacher of Otto III, and Pope Gregory V (996–999), Otto III's cousin, appointed him archbishop of Ravenna in 998.