After the French Revolution in the late 18th century Northern Italy was conquered by the French armies, many client republics were created by Napoleon and in 1805 a new Kingdom of Italy, made of all of Northern Italy but Piedmont that was annexed to France, was established with Milan as capital and Napoleon as head of state. In the congress of Vienna, the Kingdom of Sardinia was restored, and furthermore enlarged by annexing the Republic of Genoa to strengthen it as a barrier against France. The rest of Northern Italy was under Austrian rule, either direct like in the Lombardo-Venetian Kingdom or indirect like in the Duchies of Parma and Modena.