The son of a Paraguayan merchant and a half-brother of Ricardo López Jordán, he achieved fame when young in the military of his birth town.After the defeat of the Baron von Holmberg, the commander of the centralist side, Ramírez joined Hereñú to defend the Banda Oriental against the Portuguese invasions.The Supreme Director Juan Martín de Pueyrredón attempted a conciliatory policy and made a pact with Hereñú to reincorporate Entre Ríos into the Buenos Aires faction.José Miguel Carrera, who was prevented from returning to Chile, joined Carlos María de Alvear against Pueyrredón, and called both López and Ramírez in their support.San Martín refused to return with the Army of the Andes to support Buenos Aires, and Ramírez and López prevailed at the Battle of Cepeda, signing the Treaty of Pilar with the city.