When you find yourself in a hole, stop digging. That advice is easier given than followed. The temptation to “double down” on bad ideas can be overpowering, especially in foreign policy where the political and diplomatic costs of admitting error can be substantial. But sometimes presidents recognize they have dug a hole for themselves and stop digging. The U.S. invasion of Veracruz on April 21, 1914 offers a dramatic example. Within a span of four days President Woodrow Wilson went from hawk to dove.

The immediate trigger for the invasion of Veracruz came twelve days earlier when nine unarmed U.S. sailors went ashore at the Mexican port of Tampico to purchase gasoline. They unintentionally wandered into an area that was off limits to foreigners and were arrested. It took a few hours to straighten things out, in good part because the American sailors spoke no Spanish and their Mexican counterparts spoke no English. When more senior Mexican officials learned of the arrests, they ordered the sailors released and the senior Mexican general on the scene apologized to the Americans.

The incident might have ended there, a lamentable example of cross-cultural miscommunication, except for two things. One was that the commander of the U.S. fleet off Tampico, Admiral Henry Mayo, thought that an oral apology was insufficient. He could forgive what he saw as an insult to American dignity only if the Mexicans gave the American flag a full twenty-one gun salute.

The Water's Edge James M. Lindsay analyzes the politics shaping U.S. foreign policy and the sustainability of American power. 2-4 times weekly. View all newsletters >

The other complicating factor was that President Wilson had long been hoping to push Mexico’s leader, General Victoriano Huerta, from power. Mexico had been in the midst of a revolution for nearly four years by the time of the Tampico incident. Huerta had come to power in February 1913 by ousting his predecessor Francisco Madero and having him killed. When Wilson took the oath of office two months later, he pointedly refused to recognize Huerta’s legitimacy, saying the Mexican general led a “government of butchers.” Ever the moralist, Wilson told the British ambassador to the United States later that fall, “I am going to teach the South American republics to elect good men.”

So Wilson saw in the events in Tampico as an opportunity to put pressure on Huerta, who by April 1913 looked to be on the losing side of the civil war that had come to grip Mexico. Wilson backed Admiral Mayo’s demand for a full twenty-one gun salute, telling the Huerta government on April 18 that it would face consequences if it refused. A last ditch effort to broker a diplomatic resolution to the crisis failed. No salutes were fired.

With his ultimatum ignored, Wilson decided to make good on his threat. On April 20 he appeared before a hastily called joint session of Congress to ask for legislation to authorize U.S. military action:

No doubt I could do what is necessary in the circumstances to enforce respect for our Government without recourse to the Congress, and yet not exceed my constitutional powers as President; but I do not wish to act in a matter possibly of so grave consequence except in close conference and cooperation with both the Senate and House. I, therefore, come to ask your approval that I should use the armed forces of the United States in such ways and to such an extent as may be necessary to obtain from General Huerta and his adherents the fullest recognition of the rights and dignity of the United States, even amidst the distressing conditions now unhappily obtaining in Mexico.

Within hours the House voted overwhelmingly to approve Wilson’s request. The Senate took two days to act, but it too voted to use force against Mexico.

By that time, however, U.S. military operations had already begun. At around 11:00 a.m. on April 21, eight hundred marines and sailors landed in Veracruz, Mexico, two hundred miles south of Tampico. Early in the crisis Wilson and his advisers had discussed the possibility of a naval blockade and potential landing at Veracruz because it would deny Huerta access to a major port and thereby perhaps doom his hold on power. Then news arrived that the German freighter Ypiranga was about to dock in Veracruz to deliver 200 machine guns and 15 million rounds of ammunition. Believing that the weapons would strengthen Huerta’s forces in Mexico’s civil war and possibly be used against any invading U.S. force, Wilson ordered that the city be taken.

(The saga of the Ypiranga didn’t end at Veracruz. The U.S. Navy detained the ship when it arrived in Veracruz. But because the United States had no right under international law to do so, Washington eventually had to apologize to the German government. The weapons on board the ship had all been purchased legally in the United States, so the Ypiringa was allowed to leave Veracruz with its cargo. The ship continued on its scheduled travel around the Gulf of Mexico—stopping at Mobile, Alabama among other places—before delivering its weapons to the Huerta government at Puerto Mexico south of Veracruz on May 27.)

Wilson thought that the U.S. invasion would be quick and painless because ordinary Mexicans would welcome the invading Americans. But like presidents before him and after him, he miscalculated how the military operation would unfold. Although most of Huerta’s troops pulled back from Veracruz rather than engage the Americans, Mexican naval cadets and local citizens fought back. All told, nineteen Americans and more than a hundred and fifty Mexicans were killed in the fighting. Worse yet for Washington, Huerta’s adversaries in Mexico denounced the American intervention. Suddenly it looked as if a second Mexican-American war was on the horizon.

The debate back in Washington over what to do next was sharp. Secretary of War Lindley Garrison argued for sending more troops to Mexico. Secretary of State William Jennings Bryan argued the opposite, worrying that sending more troops would put the United States on the road to war with Mexico. He pushed instead for withdrawing U.S. military forces as quickly as possible.

As much as Wilson wanted to remove Huerta from power, he was not keen on war. But neither did the want to admit publicly that he had blundered, which is what unilaterally withdrawing from Veracruz would have entailed. Wilson found an escape from the dilemma he had created for himself on April 25 when the ambassadors from Argentina, Brazil, and Chile offered to mediate the dispute. Wilson immediately accepted the proposal. The negotiators met in Canada at the Niagara Falls Peace Conference in May. The difficult talks ultimately produced a formula for the withdrawal of both U.S. and Mexican forces from Veracruz. That result, however, had less to do with the diplomatic prowess of the negotiators and more to do with Huerta’s crumbling position at home. By July 1914 he was out of power and in exile.

Why did Wilson reverse course on his Mexican intervention? Part of the answer likely lies in his deep regret at the loss of American lives in Veracruz. A reporter who attended a press conference Wilson held on April 23 described him as:

preternaturally pale, almost parchmenty. . . . The death of American sailors and marines owing to an order of his seemed to affect him like an ailment. He was positively shaken.

Wilson later lamented to a biographer: “The thought haunts me that it was I who ordered those young me to their deaths.”

Wilson’s decision probably also reflected cold-eyed diplomatic and political calculations. Foreign capitals were virtually unanimous in condemning U.S. aggression. Many of Wilson’s supporters denounced the invasion as well.

And finally, on Veracruz Wilson was able to admit to himself—as he would tragically fail to do five years later in the battle over the Treaty of Versailles—that he had badly miscalculated. The intervention had not weakened Huerta; if anything, it looked to be strengthening him. Upping the ante on the crisis would make things worse, not better.

Wilson’s decision to reverse course on Veracruz did not, however, mean the end of his problems with Mexico. Two years later, Pancho Villa’s forces raided Columbus, New Mexico. Wilson responded by sending more than 12,000 troops across the Mexican border to hunt down Villa. Wilson had no more success in achieving his goals with that intervention than he did with the invasion of Veracruz.