The Second Occupation of Cuba, also known as the Cuban Pacification, was a major US military operation that began in September 1906. After the collapse of President Palma's regime, US President Roosevelt ordered an invasion and established an occupation that would continue for nearly two-and-a-half years. The stated goal of the operation was to prevent fighting between the Cubans, to protect North American economic interests, and to hold free elections. In 1906, the United States representative William Howard Taft, notably with the personal diplomacy of Frederick Funston, negotiated an end of the successful revolt led by the young general Enrique Loynaz del Castillo, who had served under Antonio Maceo in the final war of independence. Estrada Palma resigned, and the United States Governor Charles Magoon assumed temporary control until 1909. In this period, Agustín Martín Veloz and Francisco (Paquito) Rosales founded the embryonic Cuban Communist Party in the area of Manzanillo. Following the election of José Miguel Gómez in November 1908, Cuba was deemed stable enough to allow a withdrawal of American troops, which was completed in February 1909.