The failure of the U.S. to ratify the treaty meant that Mexico's sovereignty was not later undermined by giving free passage to the U.S. across the Isthmus of Tehuantepec, which Juárez had agreed to. But, under his leadership, Mexico received aid from the US that enabled the liberals to overcome the conservatives' initial military advantage. Juárez's government successfully defended Veracruz from assault twice during 1860, and recaptured Mexico City on 1 January 1861.
But, after two groups of conservatives ambushed and killed major liberal politicians Melchor Ocampo and later Santos Degollado in 1861, the liberals were outraged. Juárez took "extreme measures" to deal with the conservatives. After the scandal of Ocampo's murder, the liberal-majority Congress gave Juárez the money and power that he needed to defeat the conservatives.
After the defeat of the Conservatives on the battlefield, in March 1861 elections were held and Juárez was elected President in his own right under the Constitution of 1857. However, the Liberals' celebrations of 1861 were short-lived. The war had severely damaged Mexico's infrastructure and crippled its economy. Although the Conservatives had been defeated, they did not disappear, and the Juárez government had to respond to pressures from these factions. He was forced to grant amnesty to captured Conservative guerrillas still resisting the Juárez government, despite their executions of Ocampo and Degollado.
Juárez's government also faced international dangers. In view of the government's desperate financial straits, Juárez canceled repayments of interest on foreign loans taken out by the defeated conservatives. Spain, Britain and France, angry over unpaid Mexican debts, sent a joint expeditionary force that seized the Veracruz Customs House in December 1861. Spain and Britain soon withdrew. They realized that the French Emperor Napoleon III intended to overthrow the Juárez government and establish a Second Mexican Empire, with the support of remaining Conservatives. Thus began the French invasion in 1861 and the outbreak of an even longer war, with Liberals attempting to oust the foreign invaders and their Conservative allies and save the Republic.