Diego Gelmírez or Xelmírez was the second bishop and first archbishop of the Catholic Archdiocese of Santiago de Compostela in Galicia, modern Spain. He is a prominent figure in the history of Galicia and an important historiographer of the Iberia of his day. Diego involved himself in many quarrels, ecclesiastical and secular, which were recounted in the Historia Compostelana, which covered his episcopacy from 1100 to 1139 and serves as a sort of gesta of the bishop's life.
He was probably born at Catoira, where his father, Gelmiro or Xelmirio, was the custodian of the castle. He received an education at the court of Alfonso VI of Castile. In 1092, Raymond, count of Galicia, named him his notary and secretary and in 1093 he was the administrator of the Compostelan church. In 1094, Dalmatius was appointed the first bishop of Compostela. Dalmatius died the next year and the people of the see requested the king nominate Diego administrator again during the vacancy. In 1099, the pope authorised a new episcopal election and Diego was chosen the next year. He was anointed the second bishop of Compostela in 1101.