Since the 6th century, the area was populated by Slavs, but the Eastern Roman Empire held a nominal control over the region until the 8th century when Balkan Slavs achieved de facto independence from the Eastern Empire. It was also ruled by Avar Khaganate before their demolition by Charlemagne. The area was subsequently included into the Bulgarian Empire and was alternately ruled by the Bulgarian Empire, the Byzantine Empire and the Kingdom of Hungary until the 13th century.