Geoffrey Talbot and Miles of Gloucester set up siege engines so that the castle was attacked from two directions, and the garrison eventually surrendered. In 1154 Matilda's son Henry II granted the motte of Hereford to Roger of Gloucester but a rebellion followed and Henry retook possession and for the rest of its history the castle remained royal. In 1216 John made Walter de Lacy sheriff of the county of Herefordshire and granted him the custody of the Royal castle at Hereford and the following year work was undertaken to strengthen the castle against the Welsh attacks.