Oslo is the capital of and the most heavily populated city in Norway. Established around 1048 by King Harald III, the city rose to a bishopric in 1070 and a capital under Haakon V around 1300. Personal unions with Denmark from 1397 to 1523 and again from 1536 to 1814 and with Sweden from 1814 to 1905 decreased its impact. After being ruined by a fire in 1624, the city was relocated closer to Akershus Castle throughout the regime of King Christian IV and renamed Christiania in his honor.