<P> On 31 October 1861, France, Britain, and Spain agreed to the Treaty of London, a joint effort to extract repayment from the Mexican government . On 8 December, the Spanish fleet arrived and disembarked troops at Veracruz, Veracruz, in the Gulf of Mexico coast . When the British and the Spanish discovered that France had unilaterally planned to seize Mexico, they withdrew from the coalition . The subsequent French invasion of the Mexican republic created the Second Mexican Empire, a client state of Imperial France . </P> <P> Moreover, in Mexico, the Roman Catholic Church, upper - class conservatives, and some Indian communities welcomed, accepted, and collaborated with the French - imposed monarchy . The presidency of Benito Juárez was interrupted by the imposed rule of the House of Habsburg in Mexico . In political reaction to the Liberalism of President Benito Juárez and his government, the conservatives and much of the Mexican nobility tried to revive monarchy by collaborating with the French foreigners to install an Austrian archduke, Maximilian Ferdinand, as the Emperor Maximilian I of Mexico . </P> <P> Politically, the French intervention to Mexico reconciled the Second French Empire and the Austrian Empire, whom the French had defeated in the Franco--Austrian War of 1859 . French imperial expansion into Mexico counterbalanced the geopolitical power of the Protestant Christian United States by developing a powerful Roman Catholic empire in Latin America, and the exploitation of the mineral wealth of the Mexican northwest . After much guerrilla warfare that continued after the Republican' Capture of Mexico City--the French Empire withdrew from Mexico and abandoned the Mexican monarch . Subsequently, on 19 June 1867, the republicans executed Maximilian I and restored the Mexican Republic . </P> <P> The British, Spanish and French fleets arrived at Veracruz, between 8 and 17 December 1861 intending to pressure the Mexicans into settling their debts . The Spanish fleet seized San Juan de Ulúa and subsequently the capital Veracruz on 17 December . The European forces advanced to Orizaba, Cordoba and Tehuacán, as they had agreed in the Convention of Soledad . The city of Campeche surrendered to the French fleet on 27 February 1862, and a French army, commanded by General Lorencez, arrived on 5 March . When the Spanish and British realised the French ambition was to conquer Mexico, they withdrew their forces on 9 April, their troops leaving on 24 April . In May, the French man - of - war Bayonnaise blockaded Mazatlán for a few days . </P>

How long did the french stay in mexico