The bailey functioned as an administrative centre when the main castle stood empty. In addition to the governor-general the lord-lieutenant lived there during the 17th century and after the period of Greater Wrath it housed the provincial government for some time. One of the most colourful periods in the castle's history was when it was a prison from the 18th century to the end of 19th century. When the Finnish war began in 1808 the castle was used by the Russian navy and only handed over to the Finnish authorities a couple of decades later, after the country had been granted autonomous status within the Russian empire. The Turku Historical Museum founded in 1881 began its occupation of the bailey immediately after the museum was founded and later it was given quarters in the castle itself.