But when he signed a treaty with the Spaniards on 27 January 1865, which was considered derogatory to Peruvian national honor, a general uprising followed, so on November 7, 1865, he delivered the executive office to the vice-president and retired to Europe, settling in Richmond, England. He returned in 1871 and lived in retirement in Chorrillos until his death.