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. Cambridge Castle remained only a basic fortification until 1284 when Edward I decided to undertake major expansion works. Over the next 14 years the king spent at least £2,630 on rebuilding the castle in stone. Edward's castle was four-sided, with circular towers at each corner, guarded by a gatehouse and a barbican. A circular stone keep was built on the motte. The result was a "major fortress in the latest fashion", albeit never quite completed. Edward stayed at the castle for two nights in 1294. 14th-17th centuries During the 14th century the castle was allowed to fall into disrepair. From Edward III onwards, little money was spent on maintaining the property and by the 15th century the castle was in ruins. The castle hall and chamber were roofless by the 15th century, and Henry VI ordered these buildings to be destroyed and the stone reused for constructing King's College in 1441, with other parts of the castle being used to help build Trinity College's chapel. More stonework was given away by Mary I in the 16th century for building a mansion at nearby Sawston in the Fens, and other grants of stone given to Emmanuel and Magdalene colleges. By 1604 only the gatehouse, used as a gaol, and the keep remained intact, with the surrounding walls described by contemporaries as "rased and utterly ruinated". Civil war broke out in England in 1642 between the rival factions of the Royalists and Parliament. Cambridge Castle was occupied by Parliamentary forces in the first year of the war. Oliver Cromwell ordered emergency work to be conducted