The history of Estonia has been rather varied. The first settlers arrived in what is now Estonia following the end of the Last Ice Age. The population settled on a more permanent basis when crop and livestock farming became more established as the livelihoods of the peoples living in the area c. 1000–500 BCE. During the first millennium of the Common Era, administrative subdivisions began to emerge in Estonia.
Over the centuries, Estonia has been ruled by several foreign peoples. First, efforts were made by the Russians to strengthen their power, then the southern parts of Estonia were attacked by the Germans and the northern parts by the Danes. Estonians rebelled against the foreign rulers on many occasions but with poor outcomes. The Germans ruled Estonia until the 1500s in the estates-based society which they formed and which to some extent remained in place even following the end of the German rule.
After the Germans, the Russians, Danes, Swedes as well as the Poles sought to conquer Estonia. Following several battles and peace treaties, Estonia ended up under Swedish rule. Under the Swedish rule, Estonian elementary mass education was developed and a university was established in Tartu. Although this period is still referred to in Estonia as the “good old Swedish period”, the final years of the Swedish rule in particular were difficult. Famine, diseases and wars caused a significant cut in the Estonian population.
The Swedish rule ended with the Great Northern War, and the 1721 Treaty of Nystad resulted in the transfer of Estonia from Sweden to Russia but, in practice, the German nobility was allowed to remain in power, German was still the official language and Lutheranism the official religion. Estonian peasants still remained serfs (unfree workers), with serfdom finally abolished by means of the peasant laws enacted in 1816 and 1819.
The First World War and the Russian revolutions resulted in Estonia being granted autonomy in 1917. During the war, Germany occupied Estonia, which declared independence on 24 February 1918, but failed to reach independence at that point. Estonia finally became an independent state when the War of Independence ended with the Treaty of Tartu in 1920.
Estonia only had time to build its independent republic and its governance and other bodies for less than two decades until the start of the Second World War. During the Second World War, the Soviet Union both occupied the Baltic states as well as agreed with Estonia on military cooperation. Following the various stages of war, Estonia was annexed to the Soviet Union, from which it separated and re-established independence decades later in 1991.