Walmer Castle is an artillery fort originally constructed by Henry VIII in Walmer, Kent, between 1539 and 1540. 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 and four circular bastions, the moated stone castle covered 0.61 acres (0.25 ha) and had 39 firing positions on the upper levels for artillery. It cost the Crown a total of £27,092 to build the three castles of Walmer, Sandown, and Deal, which lay adjacent to one another along the coast 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 gardens around the property. By 1904, the War Office agreed that Walmer had no remaining military utility and it passed to the Ministry of Works. Successive Lord Wardens continued to use the property but it was also opened to the public. Walmer was no longer considered a particularly comfortable or modern residence, however, and Lord Curzon blamed the poor condition of the castle for his wife's death in 1906.
Lord Wardens since the Second World War have included Winston Churchill, Robert Menzies and Queen Elizabeth The Queen Mother, but they have made only intermittent use of Walmer Castle. In the 21st century, Walmer Castle is run as a tourist attraction by English Heritage. The interior of the castle displays a range of historical objects and pictures associated with the property and its Lord Wardens, protected since the 19th century by special legislation. The grounds include the Queen Mother's Garden, designed by Penelope Hobhouse as a 95th birthday gift for Elizabeth in 1997.