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 1859, Lombardy was ceded to the Kingdom of Piedmont-Sardinia, which would become the Kingdom of Italy in 1861.