Upnor Castle is an Elizabethan artillery fort located on the west bank of the River Medway in Kent. It is in the village of Upnor, opposite and a short distance downriver from the Chatham Dockyard, at one time a key naval facility. The fort was intended to protect both the dockyard and ships of the Royal Navy anchored in the Medway. It was constructed between 1559 and 1567 on the orders of Elizabeth I, during a period of tension with Spain and other European powers. The castle consists of a two-storeyed main building protected by a curtain wall and towers, with a triangular gun platform projecting into the river. It was garrisoned by about 80 men with a peak armament of around 20 cannon of various calibres.
Despite its strategic importance, the castle and the defences of the Thames and Medway were badly neglected during the 17th century. The Dutch Republic mounted an unexpected naval raid in June 1667, and the Dutch fleet was able to breach the defences, capturing two warships and burning others at anchor in the river at Chatham, in one of the worst defeats suffered by the Royal Navy. Upnor Castle acquitted itself better than many of the other defensive sites along the upper Medway, despite its lack of provisioning. Gun fire from the fort and from adjoining emplacements forced a Dutch retreat after a couple of days, before they were able to burn the dockyard itself.
The raid exposed the weaknesses of the Medway defences and led to the castle losing its role as an artillery fortification. New and stronger forts were built further downriver over the following two centuries, culminating in the construction of massive casemated forts such as Garrison Point Fort, Hoo, and Darnet Forts. Upnor Castle became a naval ammunition depot, storing great quantities of gunpowder, ammunition, and cannon to replenish the warships that came to Chatham for repair and resupply. It remained in military use until as late as 1945. The castle was subsequently opened to the public and is now an English Heritage property.