In 969, Borrell II made a pilgrimage to Rome, taking Gerbert with him. There Gerbert met Pope John XIII and Emperor Otto I. The pope persuaded Otto I to employ Gerbert as a tutor for his young son, Otto II. Some years later, Otto I gave Gerbert leave to study at the cathedral school of Rheims where he was soon appointed a teacher by Archbishop Adalberon. When Otto II became sole emperor in 973, he appointed Gerbert the abbot of the monastery of Bobbio and also appointed him as count of the district, but the abbey had been ruined by previous abbots, and Gerbert soon returned to Rheims. After the death of Otto II in 983, Gerbert became involved in the politics of his time. In 985, with the support of his archbishop, he opposed King Lothair of France's attempt to take Lorraine from Emperor Otto III by supporting Hugh Capet. Hugh became king of France, ending the Carolingian line of kings in 987.