He enlisted as an officer in the army of the New Granadan Union and led forces in the Magdalena Campaign against cities in the lower Magdalena River that had refused to accept Cartagena's authority or that of the Union, and then attacked Ocaña.