Promoted to rear-admiral, in 1884 he was designated as Chilean minister plenipotentiary (ambassador) to Madrid. His mission was to negotiate a definitive peace treaty with Spain to end the Chincha Islands War. Taking sick, he asked for leave to return to Chile. He died at sea on the return trip, off the Tenerife coast, on 13 May 1886.