The territory of modern Ukraine has been inhabited since 32,000 BC. During the Middle Ages, the area was a key centre of East Slavic culture, with the powerful state of Kievan Rus' forming the basis of Ukrainian identity. Following its fragmentation into several principalities in the 13th century and the devastation created by the Mongol invasion, the territorial unity collapsed and the area was contested, ruled, and divided by a variety of powers, including the Polish–Lithuanian Commonwealth, Austria-Hungary, the Ottoman Empire, and Tsardom of Moscovy. A Cossack Hetmanate emerged and prospered during the 17th and 18th centuries, but its territory was eventually split between Poland and the Russian Empire. In the aftermath of the Russian Revolution, a Ukrainian national movement for self-determination emerged, and the internationally recognized Ukrainian People's Republic was declared on 23 June 1917. After World War II, the western part of Ukraine merged into the Ukrainian Soviet Socialist Republic, and the whole country became a part of the Soviet Union. Ukraine gained its independence in 1991, following the dissolution of the Soviet Union.