Known as Serdica in Antiquity and Sredets in the Middle Ages, Sofia has been an area of human habitation since at least 7000 BC. The recorded history of the city begins with the attestation of the conquest of Serdica by the Roman Republic in 29 BC from the Celtic tribe Serdi. During the decline of the Roman Empire, the city was raided by Huns, Visigoths, Avars and Slavs. In 809 Serdica was incorporated into the Bulgarian Empire by Khan Krum and became known as Sredets. In 1018, the Byzantines ended Bulgarian rule until 1194, when it was reincorporated by the reborn Bulgarian Empire. Sredets became a major administrative, economic, cultural and literary hub until its conquest by the Ottomans in 1382. From 1530 to 1826, Sofia was the regional capital of Rumelia Eyalet, the Ottoman Empire's key province in Europe. Bulgarian rule was restored in 1878. Sofia was selected as the capital of the Third Bulgarian State in the next year, ushering a period of intense demographic and economic growth.