Until 1795 the Netherlands was a republic comprising a federation of seven autonomous provinces. During the French occupation, the Dutch Republic was transformed into a modern unitary state, the Batavian Republic (1795-1806). It then became a Kingdom, when the Emperor Napoleon installed his brother Louis as King of Holland (1806-1810). The Netherlands regained its independence in 1813, and the first Constitution for the Kingdom of the Netherlands dates from 1814.