Tomsk originated with a decree from Tsar Boris Godunov in 1604 after Toian, the Tatar duke of Eushta, asked for the Tsar's protection against Kirghiz bandits. The Tsar sent 200 Cossacks under the command of Vasily Fomich Tyrkov and Gavriil Ivanovich Pisemsky to construct a fortress on the bank of the Tom River, overlooking what would become the city of Tomsk. Toian ceded the land for the fortress to the Tsar.
In 1804 the Imperial Russian government selected Tomsk as the seat of the new Tomsk Governorate, which would include the modern cities of Novosibirsk, Kemerovo, and Krasnoyarsk, as well as the territories now in Eastern Kazakhstan. The new status brought development and the city grew quickly.
The discovery of gold in 1830 brought further development to Tomsk in the 19th century; however, when in the 1890s the Trans-Siberian Railway bypassed the city in favor of the village of Novonikolayevsk (Novosibirsk), development began to move south to connect with the railway. In time, Novosibirsk would surpass Tomsk in importance.
In the mid-19th century one fifth of the city's residents were exiles. However, within a few years, the city would be reinvented as the educational center of Siberia with the establishment of Tomsk State University (founded in 1880) and Tomsk Polytechnic University (founded in 1896). By World War II, every twelfth resident of the city was a student, giving rise to the city's informal name - the Siberian Athens.
After the October Revolution of 1917 the city became a notable center of the White movement, led by Anatoly Pepelyayev and Maria Bochkareva, among others. After the victory of the Red Army in the 1920s, Soviet authorities incorporated Tomsk into the West Siberian Krai and later into Novosibirsk Oblast.
Like many Siberian cities, Tomsk became the new home for many factories relocated out of the war zone from 1941. The resulting growth of the city led the Soviet government to establish the new Tomsk Oblast, with Tomsk serving as the administrative center.
During the Cold War Tomsk became one of many designated closed cities, which outsiders and, in particular, foreigners, could not visit. In 1949 matters went a stage further with the establishment of a secret city, known as "Tomsk-7" (or sometimes simply as "Postbox 5") 15 kilometres (9 miles) north-west of Tomsk; the new settlement became the home of the Tomsk Nuclear Plant (subsequently renamed the Sibirskaya Nuclear Power Plant), the Soviet Union's first industrial-scale nuclear-power station. Tomsk-7 received municipal status in 1956 and was renamed Seversk in 1992.