Hugh the Chaplain (or Hugo Capellanus) was the royal Chaplain of King William I of Scotland before becoming Bishop of Cell Rígmonaid (St Andrews), the highest ranking Scottish see of the period. After the death of Bishop Richard, King William selected Hugh to succeed to the bishopric in 1178. However, unbeknown to the king, the chapter elected their archdeacon, John l'Escot, as bishop. The king saw to Hugh's election and consecration in the same year. There followed a five-year struggle for the bishopric. John travelled to appeal to Pope Alexander III, who quashed the case of Hugh and sent to Scotland a man name Alexius as legate. Alexius obtained entrance to William's kingdom, and consecrated John at Holyrood Abbey in the presence of four other Scottish bishops, in the year 1180. Nevertheless, the struggle continued, and in 1183, both John and Hugh resigned their rights. Despite the fact that Hugh received the bishopric and John took the Bishopric of Dunkeld in compensation, dispute over revenues continued. When Hugh refused to answer his summons to Rome in 1186, he was suspended and excommunicated, with the diocese being put under interdict. Hugh travelled to Rome and obtained absolution, but he died of the pestilence in that city a few days later.