King Hakon Magnusson constructed Akershus Fortress in 1299 in order to protect the city of Oslo from potential enemy attacks. Throughout the centuries, the fortress has served multiple purposes ranging from the royal residence to a prison.