 According to the work "De Administrando Imperio" written by the 10th-century Byzantine Emperor Constantine VII, the Croats had arrived in Roman province of Dalmatia in the first half of the 7th century after they defeated the Avars.However, that claim is disputed and competing hypotheses date the event between the 6th and the 9th centuries.Eventually two dukedoms were formed—Duchy of Pannonia and Duchy of Croatia, ruled by Ljudevit and Borna, as attested by chronicles of Einhard starting in 818.