After the fall of the Western Roman Empire, it came under the control of the Lombards and was first ruled by feudal lords from the local area. During the Middle Ages it belonged to the Kingdom of Italy. In the 14th century it fell under the rule of the Duchy of Milan due to the House of Visconti and House of Sforza. Sondrio and Valtellina were strategically important in the politics of Europe, especially in the sixteenth and 17th century religious wars, due to their connections to Europe by Sondrio's Spluga Pass and valleys. Upon the collapse of the Duchy of Milan, rule over Sondrio was exercised by the Swiss Canton of Graubünden. Valtellina was invaded in 1622 by the Spanish Governor of Milan as the valleys had been used to transport troops around Europe; the Spanish efforts were assisted by a 1620 revolt in Valtellina against the Swiss.