After Orbegoso and Santa Cruz reached an agreement, the country ceased to exist as a sovereign state on October 20, 1838 and instead became an autonomous republic within the confederation until its defeat by Agustín Gamarra and his United Restoration Army in 1839.
Orbegoso led a military campaign against Andrés de Santa Cruz together with the opponents of the confederation and were first allied with the Peruvian-Chilean alliance of the United Restoration Army.
After being shot, he hid on the seashore remaining barely alive until the next day, where drenched and cold, he found refuge in the port within the Real Felipe Fortress.
[2] Thus, Santa Cruz managed to maintain the rebel state on his side as an autonomous republic by turning it against the restorer allies, causing the imminent invasion of the Confederate north and putting in its place the provisional Peruvian government of Agustín Gamarra, ignoring the regime of Orbegoso.
A year later, the Confederates launched a reconquest campaign in the north, causing the restorers to flee and re-annexing the northern Peruvian territory.