King Otto I over the Magyars in 955 in the Battle of Lechfeld, were the Swiss territories reintegrated into the empire. In the 12th century, the dukes of Zähringen were given authority over part of the Burgundy territories which covered the western part of modern Switzerland. They founded many cities, including Fribourg in 1157, and Bern in 1191. The Zähringer dynasty ended with the death of Berchtold V in 1218, and their cities subsequently became reichsfrei (essentially a city-state within the Holy Roman Empire), while the dukes of Kyburg competed with the house of Habsburg over control of the rural regions of the former Zähringer territory. Under the Hohenstaufen rule, the alpine passes in Raetia and the St Gotthard Pass gained importance. The latter especially became an important direct route through the mountains. Uri (in 1231) and Schwyz (in 1240) were accorded the Reichsfreiheit to grant the empire direct control over the mountain pass. Most of the territory of Unterwalden at this time belonged to monasteries that had previously become reichsfrei. The extinction of the Kyburg dynasty paved the way for the Habsburg dynasty to bring much of the territory south of the Rhine under their control, aiding their rise to power. Rudolph of Habsburg, who became King of Germany in 1273, effectively revoked the status of Reichsfreiheit granted to the "Forest Cantons" of Uri, Schwyz, and Unterwalden. The Forest Cantons thus lost their independent status and were governed by reeves. Old Confederacy (1300–1798) Late Medieval period On 1 August 1291, the cantons of Uri, Schwyz, and Unterwalden united to defend the peace upon the death of Emperor Rudolf I of Habsburg, forming the nucleus of the Old Swiss Confederacy. By 1353, the three original cantons had been joined by the cantons of Glarus and Zug and the city-states of Lucerne, Zürich, and Bern, forming the "Old Federation" of eight states that persisted during much of the 15th century. The Holy Roman Empire build a road and bridges to connect the Middle Age industrial area of north Italy with the Rhine (linked with the other industrial area of Middle Age Europe, Burgundian Netherlands), making the peasants and bankers on the road rich, allowing them to buy specialized Italian armor and to stop paying the road collecting taxes to the Empire who built the road. At the battle of Sempach 1386, the Swiss defeated the Habsburgs, gaining increased autonomy within the