Uppsala (/ˈʊpsɑːlə, ˈʌp-/, also US: /-sələ, ˈuːpsɑːlə, ʊpˈsɑːlə/ or all ending in /-sɑːlɑː/, Swedish: [ˈɵ̂pːˌsɑːla]; archaically spelled Upsala) is the county seat of Uppsala County and the fourth-largest city in Sweden, after Stockholm, Gothenburg, and Malmö. It had 177,074 inhabitants in 2019. Uppsala Castle, built by King Gustav Vasa, served as one of the royal residences of the Swedish monarchs, and was expanded several times over its history, making Uppsala the secondary capital of Sweden during its greatest extent. Today it serves as the residence of the Governor of Uppsala County.