The Duchy of Milan was a constituent state of the Holy Roman Empire in northern Italy. It was created in 1395, when it included twenty-six towns and the wide rural area of the middle Padan Plain east of the hills of Montferrat.
During much of its existence, it was wedged between Savoy to the west, Venice to the east, the Swiss Confederacy to the north, and separated from the Mediterranean by Genoa to the south. The Duchy eventually fell to Habsburg Austria with the Treaty of Baden (1714), concluding the War of the Spanish Succession.
The Duchy remained an Austrian possession until 1796, when a French army under Napoleon Bonaparte conquered it, and it ceased to exist a year later as a result of the Treaty of Campo Formio, when Austria ceded it to the new Cisalpine Republic.
After the defeat of Napoleon, the Congress of Vienna of 1815 restored many other states which he had destroyed, but not the Duchy of Milan. Instead, its former territory became part of the Kingdom of Lombardy–Venetia, with the Emperor of Austria as its king. In 1866 the newly formed Kingdom of Italy annexed what was left of this kingdom.
At its foundation the duchy included 26 towns and spanned from the hills of Montferrat to the Lagoons of Venice, and included all the former towns of the Lombard League. Milan thus became one of the five major states of the Italian peninsula in the 15th century.
When the last Visconti Duke, Filippo Maria, died in 1447 without a male heir, the Milanese declared the so-called Ambrosian Republic, which soon faced revolts and attacks from its neighbors. In 1450 mercenary captain Francesco Sforza, having previously married Filippo Maria Visconti's illegitimate daughter Bianca Maria, conquered the city and restored the Duchy, founding the House of Sforza.
During the rule of the Visconti and Sforza, the duchy had to defend its territory against the Swiss, the French and the Venetians, until the Betrayal of Novara in 1500 when the duchy passed to the French-claim of Louis XII.(wikipedia.org)