BAP Antofagasta is one of two Type 209/1200 submarines ordered by the Peruvian Navy on 12 August 1976. She was built by the German shipbuilder Howaldtswerke Deutsche Werft AG at its shipyard in Kiel. She is named after the Naval Battle of Antofagasta during the War of the Pacific. Following sea trials in the North Sea, she arrived at its homeport of Callao in 1981. After several years in service she was overhauled by Servicio Industrial de la Marina (SIMA) at Callao in 1996.