The defeat of the Spanish was followed by a long civil war between unitarians and federalists, about the organization of the country and the role of Buenos Aires in it. Unitarians thought that Buenos Aires should lead the less-developed provinces, as the head of a strong centralized government. Federalists thought instead that the country should be a federation of autonomous provinces, like the successful States of the United States. During this period the Argentine Confederation lacked a head of state, since the unitarian defeat at the Battle of Cepeda had ended the authority of the Supreme Directors and the 1819 Constitution. There was a new attempt in 1826 to write a constitution, leading to the designation of Bernardino Rivadavia as President of Argentina, but it was rejected by the provinces. Rivadavia resigned due to the poor management at the Argentina-Brazil War, and the 1826 constitution was repealed.
During this time, the Governors of Buenos Aires Province received the power to manage the international relations of the confederation, including war and debt payment. The dominant figure of this period was the federalist Juan Manuel de Rosas, who is portrayed from different angles by the diverse historiographic flows in Argentina: the liberal history usually considers him a dictator, while revisionists support him on the grounds of his defense of national sovereignty. He ruled the province of Buenos Aires from 1829 to 1852, facing military threats from secession attempts, neighbour countries, and even European countries. Although Rosas was a Federalist, he kept the customs receipts of Buenos Aires under the exclusive control of the city, whereas the other provinces expected to have a part of the revenue. Rosas considered that this was a fair measure because only Buenos Aires was paying the external debt generated by the Baring Brothers loan to Rivadavia, the war of independence and the war against Brazil. He developed a paramilitary force of his own, the Popular Restorer Society, commonly known as "Mazorca" ("Corncob").
Rosas' reluctance to call for a new assembly to write a Constitution led General Justo José de Urquiza from Entre Ríos to turn against him. Urquiza defeated Rosas during the battle of Caseros and called for such an assembly. The Argentine Constitution of 1853 is, with amendments, still in force to this day. The Constitution was not immediately accepted by Buenos Aires, which seceded from the Confederation; it rejoined a few years later. Bartolomé Mitre was the first president of the unified country.