At the beginning of the 19th century, the political situation in Spain was extremely problematic. During the Peninsular War, the Cortes of Cádizwhich served as the Regency for the deposed Ferdinand VII collaborated on the Spanish Constitution of 1812, at that point possibly the most modern and most liberal in the world. After the war, when Ferdinand VII returned to Spain (1814), he annulled the constitution in the Manifesto of Valencia, and became an absolutist king, governing by decrees and restoring the Spanish Inquisition, abolished by Joseph I, brother of Napoleon I.