The Canton of Uri conquered the Leventina Valley in 1440. Between 1403 and 1422 some of these lands were already annexed by forces from Uri, but subsequently lost. In a second conquest Uri, Schwyz and Nidwalden gained the town of Bellinzona and the Riviera in 1500. Some of the land and the town Bellinzona itself were previously annexed by Uri in 1419 but lost again in 1422. The third conquest was fought by troops from the entire Confederation (at that time constituted by 12 cantons). In 1512 Locarno, the Maggia Valley, Lugano and Mendrisio were annexed. Subsequently, the upper valley of the Ticino River, from the St. Gotthard to the town of Biasca (Leventina Valley) was part of Canton Uri. The remaining territory ("Baliaggi Ultramontani", "Ennetbergische Vogteien", the Bailiwicks Beyond the Mountains) was administered by the Twelve Cantons.