The city of Trondheim was founded in 997.[4][5][6] It was frequently used as the seat of theking, and wascapital of Norway until 1217. In theMiddle Ages, Trondheim was the site of severalbattles, including the battle betweenKing Sverre andErling Skakke, in 1179.[7] The city has experienced several major fires - the most devastating in 1651 and 1681. The 1651 fire destroyed 90% of thebuildings in Trondheim, and the 1681 fire led to a total reconstruction of the city.
The city of Trondheim became a municipality January 1, 1838. Therural municipalities ofByneset,Leinstrand,Strinda andTiller were joined into Trondheim on January 1, 1964.
Since 1981, caves surrounding the city have been home tomateriel from theMarine Corps Prepositioning Program-Norway.