The Duchy of Milan was a 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.