in internal struggles for power within Sweden and the Kalmar Union. Not until the end of 16th century did it really enjoy peace. The castle lost its status as an administrative centre in the 17th century after Per Brahe's period as governor-general of Finland came to an end. In the Middle Ages, Turku Castle may have been a base for the notorious pirates called Victual Brothers, as there were hosts sympathetic to them. The chief of the Turku Castle in years 1395–1398 was the squire , who was on good terms with the Victual Brothers and their leaders. In one important source about the Middle Ages, Paulus Juusten's episcopal chronicle, it is said that at the turn of the 15th century, pirates and Russians would have caused great destruction to the Turku Cathedral. 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 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. 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.