Walmer Castle against Charles' brother, King James II, the townsfolk of Deal seized Walmer Castle on behalf of William III, the Prince of Orange. By the end of the century, however, the castle was increasingly regarded as out of date from a military perspective. In the 18th century, Walmer Castle became the official residence of the Lord Warden of the Cinque Ports. The Lord Warden was originally a medieval title linked to five key ports along the coast of England; the position's prominence had faded, but it still retained important judicial and military functions. When Lionel Sackville, the Duke of Dorset, was
Walmer Castle and were connected by earthwork defences. The original invasion threat passed, but during the Second English Civil War of 1648–49, Walmer was seized by pro-Royalist insurgents and was only retaken by Parliamentary forces after several months' fighting. In the 18th century, Walmer became the official residence of the Lord Warden of the Cinque Ports and was gradually modified from a military fortification into a private residence. Various Prime Ministers and prominent politicians were appointed as Lord Warden, including William Pitt, the Duke of Wellington and Lord Granville, who adapted parts of the Tudor castle as living spaces and constructed extensive