After a military career under President Porfirio Díaz, Huerta became a high-ranking officer under democratically-elected president Francisco I. Madero during the first phase of the Mexican Revolution. In February 1913 Huerta led a conspiracy against Madero, who entrusted him to control a minor revolt in Mexico City. The Ten Tragic Days - actually fifteen days - saw the forced resignation of Madero and his vice president and their murders. The coup was backed by the nascent German Empire as well the United States under the Taft Administration, but the succeeding Wilson administration refused to recognize the new regime and allowed arms sales to rebel forces. Many foreign powers did recognize the regime, but withdrew further support when revolutionary forces started to show military success against the regime; with continuing support threatened their own relationships with the American government. Huerta was forced to resign in July 1914 and flee the country to Spain, only 17 months into his presidency, after the federal army collapsed. While attempting to intrigue with German spies in the U.S. during World War I (1914–1918), Huerta was arrested in 1915 and died in U.S. custody.