Despite his promising career in the royal army, like many other American officers he defected to the pro-independence side, although a few days later he was already a member of the patriot army, fighting the rest of the campaign against the army in which he had served until then and in the that a brother of his was still training as an assistant to Brigadier Valdés, incorporated into the Peruvian army, he made the second intermediate campaign under the command of General Andrés de Santa Cruz, finding himself in the battle of Zepita for which Santa Cruz was appointed marshal.
Despite a promising career in the royal army, like many other American officers, he defected to the pro-independence side. A few days later, he joined the patriot army and fought against the same army where he had served before. His brother was still training as an assistant to Brigadier Valdés, who was incorporated into the Peruvian army. During this time, Santa Cruz commanded the second intermediate campaign, during which he appointed himself marshal for the battle of Zepita.