[4] By around 1240 Locarno had become a stronghold of the Guelph faction which supported the pope against the emperor, possibly leading to the construction or expansion of the castle.
After accepting the Visconti as their new overlords, they were quickly released from captivity and restored to their former positions under a podestà appointed by Milan.
A little south of the old main tower, a palazzo was built with ornate halls, large chimneys, and an arcade leading to the courtyard.
The Rusca family remained at the castle in the palazzo, while the castellan lived in the old main tower, known as the Rocca.
However, the Treaty of Arona, in the same year, gave the fortifications at Bellinzona to the Confederation but returned the town to France.
In 2006 the historian Marino Viganò presented evidence that the Rivellino was designed, planned and constructed by Leonardo da Vinci, though no surviving documents prove this.
The 1516 peace treaty which ended the War of the League of Cambrai gave them permanent control over much of Ticino including Locarno.
Maintaining just the palazzo remained expensive and by 1762 the Landvogt Anton Schuhmacher reported that the roof was in such poor condition that it rained in every room.
[3] The castle remained the seat of the Swiss vogt until the 1798 French invasion of Switzerland and the creation of the Helvetic Republic.