Royalists from the Isle of Man to meet Charles II in Lancashire. Having fought several battles during the Civil War's third phase, Lord Derby was captured at the Battle of Worcester on 3 September 1651 and executed at Bolton on 15 October 1651. When James left the Isle of Man he left his wife, Countess Charlotte – the renowned successful defender of Lathom House in 1644 – in command of the Isle of Man. The French-born Charlotte Stanley held Castle Rushen until a rebellion led by Manx nationalist Illiam Dhône () and the mutiny of her own garrison forced her to surrender to invading Parliamentarian forces led by Colonel Robert Duckenfield by the end of October 1651. Non-military uses of the castle Administrative centre As the defensive value of the Castle declined it was in continuous use as an administrative centre. In the 18th century a mint was located within its grounds, as was the still active southern law court of the Isle of Man. The Manx law books were also stored in The Lord's Treasury at Castle Rushen. The Castle was a meeting place in the 16th century for the 24 Keys – an early name for the Manx Parliament's lower house, the House of Keys. The Keys had no permanent residence until 1710, meeting on occasion at Castle Rushen. From 1710 the Keys met at the Bishop Wilson's library in Castletown before moving to a dedicated building (The Old House of Keys) in 1821. Since 1874 the House of Keys has been located in the Isle of Man's post-1869 capital of Douglas. Prison The 18th century saw the castle in steady decay. By the end of the century it was converted into a prison. Even though the castle was in continuous use as a prison, the decline continued until the turn of the 20th century, when it was restored under the oversight of the Lieutenant Governor, George Somerset, 3rd Baron Raglan. Following the restoration work, and the completion of the purpose-built Victoria Road Prison in 1891, the castle was transferred from the British Crown to the Isle of Man Government in 1929. After the castle had lost its other uses as a defensive structure, political residence, and meeting place for the High Court of Tynwald and the legislative assembly, its use as a prison continued, prisoners being transferred from the crypt at Peel Castle in 1780. From 1765