Trondheim has about 1000 years of history. It was founded as Kaupangen by king Olav Tryggvason in 997 AD. The city was renamed to Nidaros and became the capital of Norway until 1217. Trondheim has a number of historic buildings, the most significant being the Nidaros cathedral, which was built between 1070 and 1300. The ruins of the Kristiansten fortress, built between 1682 and 1684, are on a hill overlooking the city from the east. The Vår Frue Church is a stone church built in Romanesque and Gothic styles in the late medieval period at the end of the 12th century.