Formed with the Federal Charter of 1291, an alliance of three cantons was formed for mutual defense, chiefly against the Habsburgs. A succession of interventions by the Habsburgs led to the battles of Morgarten (1315) and Sempach (1386), resulting in independence for the confederacy. By 1353, the original three cantons had been joined by two additional cantons and three city-states.