defeated in the battles of San Juan and Chorrillos and Miraflores. Cáceres was wounded in the latter combat and taken to Lima. When the city fell in January 1881, he escaped to Jauja in the mountainous hinterland of Peru. La Breña campaign As the senior officer in the region, Cáceres was named Political - Military Chief of the departments of the center (April 26, 1881). He dedicated himself to organizing resistance against Chilean occupation, conducting a guerrilla war for which he mobilized the peasant population. Thanks to the local support, the difficult terrain and his own military skills, Cáceres defeated several Chilean expeditions sent against him at the battles of Pucará and another battle there in July 1882, Marcavalle, and La Concepción. For this feats, he was nicknamed as the Brujo de los Andes (The Andes Warlock). But in spite of all his talent and resolve, he was finally defeated by the better armed and trained Chilean forces in the Battle of Huamachuco (July 10, 1883). Even though he tried to regroup, a Peruvian government headed by Miguel Iglesias signed the Treaty of Ancón (October 10, 1883), recognizing defeat and bringing an end to the war. First Presidency (1886–1890) After the war, Cáceres refused to recognize Iglesias as president so a civil war ensued between these two factions. He evaded the enemy's army and attacked Lima on November 28, 1885, forcing Iglesias to resign on December 12. The country was ruled by a Council of Ministers headed by Antonio Arenas while new elections took place. Running for the Constitutional Party, Cáceres won the elections as sole candidate and assumed as president on June 3, 1886. The new government faced a serious economic crisis due to a huge debt and the severe damage caused by the War of the Pacific. As a solution for these problems, the Cáceres administration engaged in negotiations with its creditors, the result of which was the Grace Contract, signed on October 28, 1888, and approved by the Congress of Peru on October 25, 1889. Under the agreement, the Peruvian State handed over control of its railways, a guano concession, annual payments over 33 years and several minor concessions. In exchange, its creditors agreed to pay the country's debt and expand its railways. The Grace Contract caused widespread controversy, the Cáceres administration was accused of having sold the country's main assets at a very low price among