On 1 December 1821, the Spanish lieutenant governor José Núñez de Cáceres declared the independence from Spain. The new country had the name "Estado Independiente del Haití Español" ("Independent State of Spanish Haiti"). But on 9 February 1822, the Haitian army occupied the country and stayed for 22 years. Juan Pablo Duarte founded a secret society, "La Trinitaria", to fight for the Dominican independence. The Haitian occupation ended on 27 February 1844, when the inhabitants of the eastern part of the Hispaniola made a new country named "República Dominicana" ("Dominican Republic"). From 1861 to 1865, the country was again a Spanish colony. On 16 August 1863 began the "Restoration War" when the Dominicans fought to be free again. That war ended in 1865 when the Spanish left and the Dominican Republic was again an independent country.