The castle was besieged in 1216 during the civil war between King John and rebellious barons, who were supported by France. It was successfully captured after Prince Louis, the future Louis VIII, attacked it with siege engines for twenty days, forcing the garrison to surrender. After being retaken by royal forces the subsequent year, it was given to Richard, Earl of Cornwall, beginning a long association with the Earldom of Cornwall and the later duchy. Richard redeveloped the castle as a palatial residence, and made it the centre of the earldom's administration. Edward III further developed the castle in the 14th century and gave it to his son, Edward, the Black Prince, who expanded the hunting grounds. The castle was also used to hold royal prisoners, including John II of France and rival claimants to the English throne.