The Northern Italian cities achieved wide autonomy by the end of 10th century and chosen their sovereigns or elected their own chief of state – the doge. Besides Venice that elected doges since 762, doges also ruled Genoa and Amalfi. German Kings who were weakened by the Investiture Controversy were unable to subdue the Northern Italian cities which gained great wealth during the economic progress in the 11th century and the period of Crusades.
Venice, Milan, Genoa and Florence achieved independence by the 12th century and evolved into a powerful city-states. The attempt of Holy Roman Emperor, Frederick I Barbarossa to reassert his imperial authority in Lombardy resulted in the formation of the Lombard League under leadership of Milan and Frederick’s defeat at Legnano in 1176. Frederick I signed the Peace of Constance in 1183 and recognized the independence of the Lombard cities under his nominal suzerainty. The Lombard League was renewed against the Holy Roman Emperor, Frederick II in 1226 and repulsed his attempts to assert his authority in Northern Italy. Venice meanwhile extended its power in the Mediterranean by conquering one-fourth of the Byzantine Empire during the Forth Crusade, while Genoa gained new holdings in the Middle East.