The history of Lithuania dates back to settlements founded about 10,000 years ago, but the first written record of the name for the country dates back to 1009 AD. Lithuanians, one of the Baltic peoples, later conquered neighboring lands and established the Grand Duchy of Lithuania in the 13th century (and also a short-lived Kingdom of Lithuania). The Grand Duchy was a successful and lasting warrior state. It remained fiercely independent and was one of the last areas of Europe to adopt Christianity (beginning in the 14th century). A formidable power, it became the largest state in Europe in the 15th century spread from the Baltic Sea to the Black Sea, through the conquest of large groups of East Slavs who resided in Ruthenia. In 1385, the Grand Duchy formed a dynastic union with Poland through the Union of Krewo. Later, the Union of Lublin (1569) created the Polish–Lithuanian Commonwealth. During the Second Northern War, the Grand Duchy sought protection under the Swedish Empire through the Union of Kėdainiai in 1655. However, it soon returned to being a part of the Polish–Lithuanian state, which persisted until 1795 when the last of the Partitions of Poland erased both independent Lithuania and Poland from the political map. After the dissolution, Lithuanians lived under the rule of the Russian Empire until the 20th century, although there were several major rebellions, especially in 1830–1831 and 1863.
On 16 February 1918, Lithuania was re-established as a democratic state. It remained independent until the outset of World War II, when it was occupied by the Soviet Union under the terms of the Molotov–Ribbentrop Pact. Following a brief occupation by Nazi Germany after the Nazis waged war on the Soviet Union, Lithuania was again absorbed into the Soviet Union for nearly 50 years. In 1990–1991, Lithuania restored its sovereignty with the Act of the Re-Establishment of the State of Lithuania. Lithuania joined the NATO alliance in 2004 and the European Union as part of its enlargement in 2004.