After the successful attacks on the Lima suburbs of San Juan and Miraflores it became apparent that the city was going to fall to the advancing Chilean army. During the night of January 16, 1881, after the defeat of the Peruvian Army in the battles of San Juan and Miraflores, the Secretary of the Navy, Captain Manuel Villar, ordered the destruction of port defences and the remaining ships of the Peruvian Navy to prevent their capture by Chilean troops. This order was executed by the captains Germán Astete and Manuel Villavisencio during the dawn of January 17, 1881. Among the ships scuttled were the last Peruvian ironclad, the monitor , the training ship , as well as Peru's first submarine, .