Roman control collapsed with the Hunnic invasions of 370–410 and Pannonia was part of the Ostrogothic Kingdom during the late 5th to mid 6th century, succeeded by the Avar Khaganate (6th to 9th centuries) civil. The Magyar invasion took place during the 9th century.