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 federals, 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 in the war against brazil. san martín refused to help lavalle at all, and returned to europe. the "hacendado" juan manuel de rosas organized a militia with people from the countryfield 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.