The military reputation of Baquedano was enhanced by his outstanding direction and participation in the battles of Chorrillos and Miraflores, in January 1881. There, thanks to the efforts of the men under his command, the Peruvian capital was occupied in less than a month. Baquedano returned to Chile when the government of President Aníbal Pinto decided to bring home most of the Army, due to the high cost of maintaining troops. He arrived at Valparaiso in March 1881 and was received by a large crowd; the celebration was repeated in Santiago.