It formed part of the King's Device programme to protect against invasion from France and the Holy Roman Empire, and defended the strategically important Downs anchorage off the English coast. Comprising a keep with six inner and outer bastions, the moated stone castle covered 0.85 acres (0.34 ha) and had sixty-six firing positions for artillery. It cost the Crown a total of £27,092 to build the three castles of Deal, Sandown and Walmer, which lay adjacent to one another along the coast and were connected by earthwork defences.[lower-alpha 1] The original invasion threat passed but, during the Second English Civil War of 1648–49, Deal was seized by pro-Royalist insurgents and was only retaken by Parliamentary forces after several months' fighting.