Rivadavia resigned and left to Europe. The 1826 constitution was repealed, and the political organization returned to its previous state. Execution of Dorrego With the office of president abolished, the provinces ruled themselves once more. Manuel Dorrego was appointed governor of Buenos Aires. In the lack of a proper head of state, the governor of Buenos Aires received some powers to fill that void, such as managing international relations or paying the foreign debt. Dorrego's rule was short-lived. When the armies returned from the war, they organized a coup against Dorrego, headed by Juan Lavalle. Lavalle captured and executed Dorrego, appointed himself governor of Buenos Aires, closed the legislature and began a campaign against federalists, together with José María Paz. Lavalle was not recognized as a legitimate governor by the other provinces, and sought the support of José de San Martín, who had returned from Europe, to aid him in the war against Brazil. San Martín refused to help Lavalle at all, and returned to Europe. The Juan Manuel de Rosas organized a militia with people from the countryside to stand against Lavalle, while Estanislao López dealt with Paz. Lavalle was defeated by Rosas, who restored the legislature. Juan José Viamonte was appointed governor, and then Rosas himself. The Federal pact José María Paz expanded his influence across the northern provinces, creating the Unitarian League. The provinces of Buenos Aires, Santa Fe and Entre Ríos signed the Federal Pact in response, and quickly defeated the Unitarian League by capturing Paz. The Federal Pact was kept for national organization after the unitarian defeat. The provinces of Córdoba, Santiago del Estero, La Rioja and Cuyo joined the Federal Pact in 1831, Catamarca, Tucumán and Salta also joined following year. The pact served both as a military alliance (both against non-signing provinces that attacked them, or against other countries) and as a sort of constitution. The Federal Pact had an article declaring that a new constituent assembly should be called to write a constitution as soon as the military threats were defeated. The defeat of Paz and the expansion of the Federal Pact further ushered in a period of economic and political stability. As a result, federalists were divided between two political trends: those who wanted the calling of such Constituent Assembly, and those who supported Rosas in delaying it. Rosas thought that the best way to organize the Argentine Confederation was as