Upon the death of President Benito Juárez in 1872, vice-president and President of the Supreme Court Sebastián Lerdo de Tejada, the President of the Supreme Court, assumed the interim presidency, and called for new elections. The two candidates registered were Lerdo de Tejada and the General Porfirio Díaz, one of the heroes of the Battle of Puebla of 5 May 1862, who had since occupied several public positions. Díaz had challenged Juárez with his Plan de la Noria, in which he stated his opposition to presidential re-election and called for a Constitutional Congress. Lack of support for this plan led to Díaz losing the elections of 1872.
Towards the end of his term, Lerdo de Tejada, who had already incorporated the Reform laws into the Constitution of Mexico, attempted to modify the constitution to enable his re-election, prompting Díaz to declare the Plan of Tuxtepec. On 21 March 1876, Díaz rebelled against President Lerdo de Tejada. The Plan of Tuxtepec proclaimed the "No Re-election" principle and emerged as the flag of General Porfirio Díaz. The plan had the support of General Donato Guerra, the head of the Mexican army, as well as other military chiefs who helped the movement in Jalisco on February 8, 1876. In the municipalities of Lagos, Teocaltiche, Jalostotitlán and San Miguel El Alto, Generals Donato Guerra and Rosendo Márquez attacked the garrison of San Juan de los Lagos, which surrendered without a major fight. Other key figures were General Pedro Galván and Florentino Cuervo, who captured Ameca. Colonel Félix Vélez Galván took up arms in Sayula, Jalisco on 12 February.
On 20 May 1876 in Icamole, Nuevo León, General Carlos Fuero, loyal to the government of Lerdo de Tejada, inflicted a heavy defeat on Díaz's rebels, who were forced to withdraw to the south of the Republic. Despite this defeat, Díaz continued his campaign against the lerdistas.
On October 26, the Congress affirmed the re-election of Lerdo de Tejada, but the president of the Supreme Court of Justice, José María Iglesias, declared it illegal. In his role as vice-president, Iglesias pursued the interim presidency. By this failure Sebastián Lerdo de Tejada was forced to leave power.
On 16 November 1876, Díaz faced General
Ignacio R. Alatorre in the Battle of Tecoac, in the municipality of Huamantla, Tlaxcala. Both sides came close to winning the battle, but the arrival of porfirista reinforcements under the command of General Manuel González Flores, caused a decisive victory for Díaz's troops. Following a series of further battles, supporters of the Plan of Tuxtepec claimed victory, and Lerdo de Tejada had no choice but to surrender the presidency and Díaz entered Puebla in November. As a result of the plan's victory Supreme Court President Jose Maria Iglesias was appointed interim president until new elections could be held in Mexico City. As the only candidate, General Porfirio Díaz assumed the presidency on 12 May 1877.
In 1878, supported by the Plan of Tuxtepec, Díaz made two key reforms to the Constitution. The first was to remove the function of vice-president from the president of the Supreme Court of Justice. The second prohibited re-election, with a short statement that said: "Except after a period of four years", with which he started his long dictatorship and the period of Porfiriato.