 The kingdom was subdivided into a varying number of duchies, ruled by semi-autonomous dukes, which were in turn subdivided into gastaldates at the municipal level.The capital of the kingdom and the center of its political life was Pavia in the modern northern Italian region of Lombardy.The Lombard invasion of Italy was opposed by the Byzantine Empire, which retained control of much of the peninsula until the mid-8th century.