According to the Babad Banyumas, Sunan of Surakarta Pakubuwono IV first built a fortress in the Cilacap area in the early 19th century; the Central Javan branch of the Center for the Preservation of Cultural Properties suggests that Benteng Pendem may have been built over this fort. Kustbatterij op de Landtong te Tjilatjap (Coastal Battery at the Peninsula of Cilacap), the fort which is now known as Benteng Pendem, began construction in 1861. At the time, the port of Cilacap was an important one for the transportation of goods from Yogyakarta and Purworejo, and thus defended well for its strategic importance; another fortification from this period can be found in Karang Bolong, Nusa Kembangan. The fortress began operations in 1879, and held numerous prisoners – both civilian and military – while occupied by the Dutch.
During the Japanese occupation of the Dutch East Indies from 1942 to 1945, Benteng Pendem was taken over by the Japanese occupation forces. After the occupation ended, returning Dutch forces asserted control of the building, holding it until the end of the Indonesian National Revolution in 1949. Between 1952 and 1965 the fortress belonged to the Indonesian Army, and was used by the Resimen Para Komando Angkatan Darat (Regiment of Army Commandos; now Kopassus) for training purposes between 1956 and 1962.
After 1965, Benteng Pendem was left unused, and fell into disrepair and was covered in sand. Around this time the Pertamina storage facilities were built, taking land which had belonged to the fortress. It was excavated in 1986, and, after a year of preparations, the fort was opened to tourists by the Cilacap regional government in 1987. In 2002 and 2005, dangerously dilapidated areas of the fortress were fenced off. By 2013 Benteng Pendem had become the area’s prime tourist destination, as well as a Cultural Property of Indonesia.
Benteng Pendem is said to be haunted, and has often used been used as a filming location for tests of bravery; individuals are left alone, without lights, in a room for an hour.