It was the period in Mexican history from 1858 to 1861 when the federalist government collapsed and civil war ensued. In 1858 President Ignacio Comonfort (1812–1863), who had become Mexico’s leader when he helped overthrow President Antonio Lopez de Santa Anna (1794–1876) in 1855, felt political pressure and fled the country. Benito Júarez (1806–1872), who had served as minister of justice and minister of the interior, assumed the presidency. His position was immediately opposed by centralists who rallied around rebellious army forces. Under this pressure, the federalists, led by Júarez, withdrew from Mexico City and set up the capital at Veracruz, on the Gulf Coast. There they had control over customs receipts, which allowed them to purchase arms and finance their government. Eventually they defeated the centralists and reentered Mexico City in January 1861. Júarez was elected president later that year, but his authority was challenged again with the arrival of the French, who quickly put Maximilian (1832–1867) in power as emperor of Mexico. Júarez led the country in a successful campaign against the French, who were expelled in 1867 when Júarez resumed the presidency. He died in office in 1872.