Between 1910 and 1920 Mexico was torn apart by a violent revolution and subsequent civil wars. In the first decade of the 20th century, President Porfirio Diaz ruled Mexico with an iron fist as an agent of the wealthy, undoing previous land reforms. Opposition grew against Diaz and Francisco I. Madero challenged him in the 1910 election. Madero was jailed by Diaz who declared he won the election. Revolutionary actions ensued in support of Madero who defeated the Mexican army in 1911 and who was elected president in a special election. Madero turned out to be a weak president and was overthrown in a coup d'état by Victoriano Huerta, head of the army, who installed himself as president in 1913. This led to the outbreak of the first civil war in which opposition to the dictator Huerta was led by Venustiano Carranza. Carranza's forces were called the "Constitutionalists" and captured Mexico City in 1914 and installed Carranza as president. Carranza, in turn, was opposed by Francisco Villa and Emiliano Zapata, leader of the Zapatistas, in the second civil war and eventually driven out of Mexico City in 1915. Carranza reluctantly incorporated many reforms in the Constitution of 1917, but the opposition to him continued. Militarily, the war ended in 1920 with the death of Carranza and the ascension to power of General Álvaro Obregón but coup attempts and sporadic uprisings continued throughout the next decade.