as a fief. In 1291, a Humiliati monastery was first mentioned in Locarno. St. Catherine's church, attached to the monastery, probably dates to the mid-14th century. Under the Swiss Confederation The rule of the Rusca ended 1503, when the Confederates occupied Locarno, but failed to conquer the Visconti castle. After the battle of Novara in 1513, the French King Louis XII gave the Confederates the castle. In the Treaty of Freiburg in 1516, they received all of Locarno. The Twelve Cantons took turns appointing a governor (), to rule over Locarno. The governor had both civil and criminal jurisdiction, except in certain cases after 1578, where seven judges were elected by the locals to try the cases. On taking office, the Governor swore under oath to obey the statutes of Locarno. The Governor was supported by a local mayor, and criminal fines were usually given to the local community. The rule of the Twelve Cantons also had an effect on the social and political relations of the town. In addition to the nobility (representing the three old noble families Orelli, Muralto and Magoria) and citizens, there was a third group. This third group, the terrieri, was a group of residents who had lived a long time in Locarno, but were not citizens. Each of the three groups were a statutory corporation, with shared property and a governing body. Under the Confederation, each of these groups or corporations had representation in the Consiglio Magnifico which ruled Locarno. However, the town's dominance over the villages in the region, until 1798, is clearly shown in their representation in the council. The three groups in Locarno had twelve aldermen (six nobles, four citizens and two terrieri), while all the rural communities together had only eight members. During the Middle Ages, Locarno was centered around the intersection of Via Cittadella and Via S. Antonio. The town stretched up the slope of the mountain and behind the castle. Some houses lined the shore, and above the Contrada Borghese a small, almost rural settlement grew up. The center of town was dominated by townhouses with their large courtyards and gardens. The members of the upper class also owned small country houses with vineyards, which went up the hill behind Locarno as well as in Solduno and Cugnasco. Locarno also had several noble estates during the Late Middle Ages, including the so-called Cittadella. The buildings of the 17th