Federalist Buenos Aires Governor Manuel Dorrego took over the management of the foreign affairs of the United Provinces, but he was deposed and executed in 1828 by Unitarian General Juan Lavalle, who commanded troops dissatisfied with the negotiations that ended the War with Brazil. The following year, Juan Manuel de Rosas, leader of Buenos Aires Federalists, defeated Lavalle and secured his resignation. Rosas was elected Governor of Buenos Aires later that year by the Provincial Legislature. To counteract these developments, the Unitarian League was created by General José María Paz in 1830, uniting nine Argentine Provinces. The 1831 Federal Pact between Buenos Aires, Entre Ríos and Santa Fe Provinces opposed a military alliance to the League and ultimately defeated it during 1832, its former members joining the Federal Pact into a loose confederation of Provinces known as the Argentine Confederation. Although the Unitarians were exiled in neighboring countries, the Civil War continued for two decades.