 The king had come to the city to try to defend it from an imminent Almoravid attack.His body was taken to the locality of Sahagún, and was buried in the Royal Monastery of San Benito, thus fulfilling the wishes of the monarch.The mortal remains of the king were deposited in a stone sepulcher, which was placed at the feet of the church of the Royal Monastery, until the reign of Sancho IV, who deemed it unseemly that his ancestor was buried to the feet of the temple and ordered the tomb to be moved inside and placed in the church's transept, near the tomb of Beatriz, Dowager Lady of Los Cameros and daughter of Infante Frederick of Castile who had been executed by orders of his brother, King Alfonso X the Wise in 1277.