section_path: History/Middle Ages
section_name: Middle Ages
paragraph_text: Middle Ages
  
  The Roman period ends with Avar and Croat invasions in the late 6th and first half of the 7th century and the destruction of almost all Roman towns. Roman survivors retreated to more favourable sites on the coast, islands, and mountains. The city of Dubrovnik was founded by such survivors from Epidaurum.
  
  There's some uncertainty about the ethnogenesis of Croats. The most accepted theory, the Slavic theory, proposes migration of White Croats from White Croatia during the Migration Period. Conversely, the Iranian theory proposes Sarmatian - Alanic origin of Proto-Croats, based on Tanais Tablets containing Ancient Greek inscriptions of given names Χορούαθος, Χοροάθος, and Χορόαθος (Khoroúathos, Khoroáthos, and Khoróathos) and their interpretation as anthroponyms related to the Croatian ethnonym.
  
  According to the work De Administrando Imperio written by 10th-century Byzantine Emperor Constantine VII, Croats settled in the Roman province of Dalmatia in the first half of the 7th century after they defeated the Avars. Although there exist some scholarly disputes about the account's reliability and interpretation, recent archaeological data has established that the migration and settlement of the Slavs/Croats was in the late 6th and early 7th century. Eventually, a dukedom was formed, Duchy of Croatia, ruled by Borna, as attested by chronicles of Einhard starting in 818. The record represents the first document of Croatian realms, vassal states of Francia at the time. Its neighbor to the North was Principality of Lower Pannonia, at the time ruled by duke Ljudevit who ruled the territories between the Drava and Sava rivers, centred from his fort at Sisak. This population and territory throughout history was tightly related and connected to Croats and Croatia.
  
  Christianisation of Croats began in the 7th century at the time of archon Porga of Croatia, initially probably encompassed only the elite and related people, but mostly finished by the 9th century. The Frankish overlordship ended during the reign of Mislav, or his successor Trpimir I. The native Croatian royal dynasty was founded by duke Trpimir I in the mid 9th century, who defeated the Byzantine and Bulgarian forces.
  
  The first native Croatian ruler recognised by the Pope was duke Branimir, who received papal recognition from Pope John VIII on 7 June 879. Tomislav was the first king of Croatia, noted as such in a letter of Pope John X in 925. Tomislav defeated Hungarian and Bulgarian invasions. The medieval Croatian kingdom reached its peak in the 11th century during the reigns of Petar Krešimir IV (1058–1074) and Dmitar Zvonimir (1075–1089). When Stjepan II died in 1091, ending the Trpimirović dynasty, Dmitar Zvonimir's brother-in-law Ladislaus I of Hungary claimed the Croatian crown. This led to a war and personal union with Hungary in 1102 under Coloman.