During the Peninsular War, (1807–1814) Napoleon's forces began a four-year occupation of the city in December 1807, and Lisbon descended with the rest of the country into anarchy. After the war ended in 1814, a new constitution was proclaimed and Brazil was granted independence. The 20th century brought political upheaval to Lisbon and the nation as a whole. In 1908, at the height of the turbulent period of the Republican movement, King Carlos and his heir Luís Filipe were assassinated in the Terreiro do Paço. On 5 October 1910, the Republicans organised a "coup d'état" that overthrew the constitutional monarchy and established the Portuguese Republic. There were 45 changes of government from 1910 through 1926.