The first Chilean military expedition against Santa Cruz, led by Vice Admiral Manuel Blanco Encalada, failed and had to submit to the signature of the Treaty of Paucarpata, on November 17, 1837. The Chilean government then organized a second expedition, which defeated the Supreme Protector at the Battle of Yungay on January 20, 1839, and forced the dissolution of the Confederation. On August 25, 1839, General Agustín Gamarra, after assuming the presidency of Peru, officially declared the dissolution of the Confederation and the merging of the North and South Peruvian Republics into one to be called again "Peru", separate from Bolivia.