The first step towards the canton of the Grisons was when the league of the Ten Jurisdictions allied with the League of God's House in 1450. In 1471 the two leagues allied with the Grey League. In 1497 and 1498 the Leagues allied with the Old Swiss Confederacy after the Habsburgs acquired the possessions of the extinct Toggenburg dynasty in 1496, siding with the Confederacy in the Swabian War three years later. The Habsburgs were defeated at Calven Gorge and Dornach, helping the Swiss Confederation and the allied leagues of the canton of the Grisons to be recognised. However the Three Leagues remained a loose association until the "Bundesbrief" of 23 September 1524.