Porfirio Diaz appointed himself president in 1876 and ruled Mexico for over 30 years through oppression and rigged elections. Francisco Madero challenged Diaz's dictatorship but was imprisoned. Victoriano Huerta then staged a coup and took power, with encouragement from US Ambassador Henry Lane Wilson. A period of chaos ensued as revolutionary forces like Pancho Villa, Emiliano Zapata, and Venustiano Carranza vied for control of Mexico.