Many accidents have assailed the castle, especially numerous sieges. In 1614, when King Gustav II Adolf visited the castle, a tremendous fire destroyed the wooden structure of the main castle almost completely. After this the main castle was abandoned and used partly as a store, partly just stood empty. A new accident beset the castle in the summer of 1941 soon after the Continuation War had begun when a Russian incendiary bomb hit the main castle. 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 after the country had been granted autonomous status within the Russian empire a couple of decades later. 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. The renovation of the castle, which was begun before the Second World War and interrupted by Finland's two wars with the Soviet Union, was completed in 1987. The completely restored castle was handed over on October 12, 1993 to the City of Turku which is entrusted with its operation for the Finnish state, its owner. The building is owned and maintained by the Finnish state and is entrusted to the use of the city of Turku. The castle functions in its entirety as a historical museum as part of the Turku provincial museum. In the main part of the castle are banquet rooms for the city of Turku, a church for the local congregation and also restaurants in both the main castle and the bailey. Today the castle is once more experiencing a heyday as it has achieved the status of being one of Finland's most visited museums. The layout of the castle consists of the Medieval keep ("päälinna") and Renaissance bailey ("esilinna"). The keep consists of a square fort with two square gateway towers whose wall thickness at the base is some . In the Middle Ages the castle was surrounded by a moat conjoining with the River Aura, the castle effectively lying on an island. The keep was completed in the early 15th century. Construction of the bailey was begun in the late 15th century and finished in the 16th.