In 1167 the rebellious Italian communes united against Frederick in the Lombard League, and Frederick retreated with difficulty to Germany, where he turned to increasing his territorial power and pacifying the constantly feuding German princes. In 1174 he returned to Italy. He was decisively defeated (1176) at Legnano by the Lombard League, partly because of lack of support from the German princes, notably Henry the Lion.
After his defeat Frederick became reconciled with the pope; he agreed to recognize Alexander III as pope and was restored (1177) to communion. He made peace with the Lombard towns (confirmed by the Peace of Constance in 1183) and arranged a truce with the pope's Sicilian allies. After his return to Germany, Frederick brought about the downfall (1180) of Henry the Lion, whose large duchies were partitioned; Frederick's divisions of the German territories were of lasting consequence. At the Diet of Mainz (1184) the emperor celebrated his own glory in fabulous pomp. He arranged the marriage (1186) of his son and successor, Henry (later Henry VI), to Constance, heiress presumptive of Sicily, thus insuring peace with Sicily.