Under Henry II the castle was adequately maintained, but little additional work was undertaken to improve it. A castle-guard system was established, under which lands around Cambridge were granted to local lords on the condition that they provide guard forces for the castle, and the castle was primarily used to hold the sheriff's court and records. King John expanded the castle in the years before the First Barons' War of 1215 to 1217, but this work was concentrated on constructing a new hall and chamber, at the cost of £200. During the war, the rebel barons, supported by Prince Louis of France, captured much of eastern England; Cambridge Castle fell in 1216. The castle was returned to royal control after the war, but Henry III only conducted basic maintenance of the fortification. Cambridge was attacked again during the Second Barons' War in 1266. This time the town and castle held long enough to be relieved by Henry's forces, but the king reinforced the city defences with a large ditch, later known as King's Ditch.