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
Cinque Ports to levy tolls, punish those who shed blood or flee justice, punish minor offences, detain and execute criminals both inside and outside the port's jurisdiction, and punish breaches of the peace; and possession of lost goods that remain unclaimed after a year, goods thrown overboard, and floating wreckage. The leeway given to the Cinque Ports, and the turning of a blind eye to misbehaviour, led to smuggling, though common everywhere at this time becoming more or less one of the dominant industries. A significant factor in the need to maintain the authority of the Cinque Ports by the King was