Historical and old photos of Sarpsborg, Viken
The city was founded as Borg by the Viking King Olav Haraldsson (Saint Olaf) in 1016. It was burned to the ground by Swedish invaders in 1567 during the Northern Seven Years' War. Half the population was evacuated down the river to what is today known as Fredrikstad, about 15 kilometres (9 mi) downstream.
Much of the rebuilt town disappeared into the river Glomma during a 1702 mudslide. Again Borg was rebuilt, and it was recreated as a city in 1839, and separated from Tune as a municipality of its own.
The rural municipalities of Tune, Skjeberg, and Varteig were merged with the city on 1 January 1992. The population is steadily growing, and during the summer of 2005 it reached 50,000 inhabitants.
In 2016 the town celebrated its 1,000th anniversary, and the entire year was commemorated by a special programme that encouraged historic preservation within the town.