The monarch's struggle with the papacy resulted in a war that ravaged through the Holy Roman Empire from 1077 until the Concordat of Worms in 1122. The reign of the last ruler of the Salian dynasty Henry V coincided with the final phase of the great Investiture Controversy, which had pitted pope against emperor. By the settlement of the Concordat of Worms, Henry V surrendered to the demands of the second generation of Gregorian reformers. This agreement stipulated that the pope would appoint high church officials but gave the German king the right to veto the papal choices. Imperial control of Italy was lost for a time, and the imperial crown became dependent on the political support of competing aristocratic factions. Feudalism also became more widespread as freemen sought protection by swearing allegiance to a lord. These powerful local rulers, having thereby acquired extensive territories and large military retinues, took over administration within their territories and organized it around an increasing number of castles. The most powerful of these local rulers came to be called princes rather than dukes.