Some castles in Britain and Ireland continued to have modest military utility into the 18th century. Until 1745 a sequence of Jacobite risings threatened the Crown in Scotland, culminating in the rebellion in 1745. Various royal castles were maintained during the period either as part of the English border defences, like Carlisle, or forming part of the internal security measures in Scotland itself, like Stirling Castle. Stirling was able to withstand the Jacobite attack in 1745, although Carlisle was taken; the siege of Blair Castle, at the end of the rebellion in 1746, was the final castle siege to occur in the British Isles. In the aftermath of the conflict Corgaff and many others castles were used as barracks for the forces sent to garrison the Highlands. Some castles, such as Portchester, were used for holding prisoners of war during the Napoleonic Wars at the end of the century and were re-equipped in case of a popular uprising during this revolutionary period. In Ireland Dublin Castle was rebuilt following a fire and reaffirmed as the centre of British administrative and military power.