The civil war of 1859, after the revolt of Buenos Aires against Justo José de Urquiza's federal system, resulted in Mitre's defeat by Urquiza at the Battle of Cepeda, in 1860. Issues of customs revenue sharing were settled, and Buenos Aires reentered the Argentine Confederation. Victorious at the 1861 Battle of Pavón, however, Mitre obtained important concessions from the national army, notably the amendment of the Constitution to provide for indirect elections through an electoral college. In October 1862, Mitre was elected president of the republic, and national political unity was finally achieved; a period of internal progress and reform then commenced. During the Paraguayan War, Mitre was initially named the head of the allied forces.