henry iii extended the castle's role as a jail for holding a wide range of prisoners. the sheriff was responsible for the jail at this time, and his deputy usually took the role of a full-time jailer. up to three hundred and ten prisoners were held in the castle at any one time. the conditions in which prisoners were held were "appalling", and led to the widespread loss of life amongst detainees. prison escapes were relatively common, and many of them, such as the break-out by 28 prisoners in 1298, were successful. when the military order of the knights templar was dissolved in england in 1307, york castle was used to hold many of the arrested knights. the castle mills, as former templar property, returned to royal control at the same time. edward ii also used the castle as a jail in his campaign against his rebellious barons in 1322, and after the battle of boroughbridge many of the defeated rebel leaders were executed at york castle.