War of the League of Cambrai
In 1512, during the War of the League of Cambrai, the Confederation again invaded the Alpine foothills including Locarno. They besieged the castle, but did not have the artillery needed to capture it. In 1513, negotiations after the decisive Swiss victory at the Battle of Novara gave temporary control over the castle to the Swiss. The 1516 peace treaty which ended the War of the League of Cambrai gave them permanent control over much of Ticino including Locarno.