Until November 1865, Chile had been the only country firm in its declaration of war against Spain, which desired to recapture its lost South American colonies.
Through the efforts of its president, Mariano Ignacio Prado, Peru was subsequently galvanized into action against Spain.
Familiar with Spanish naval movements, the Chilean corvette Esmeralda, under the command of Juan Williams Rebolledo, and whose crew included Arturo Prat, Juan José Latorre and Carlos Condell, waited for any Spanish ships to appear between Coquimbo and Valparaíso.
Fery called out his surrender to Williams Rebolledo, who ordered Manuel Thomson to take possession of the Spanish ship.
This action, together with the general failure of Spanish operations during the Chincha Islands War, led to Pareja committing suicide on board his flagship, the screw frigate Villa de Madrid, on 28 November 1865.