The earliest remains of the Onogošt fortification date back to the 5-6th century. It was built by the East Goths. The name Anagastum derived from the gothic proper name. In the Middle Ages, from Anagastum the name Onogošt derived. The priest of Doclea mentions Onogoste in the 12th century. Later, Onogošt belonged to Duke Sandalj Hranic, who established customs office there, for which people of Dubrovnik, in 1411, demanded to be abrogated. It is possible that in the Middle Ages the name Onogošt referred to the district and not to the town, which had become abandoned after the Goths or in some later period and was rebuilt only in the Turkish times.
Onogošt is partly situated in the valley (the lower town), and partly on the rocky hill (the upper town). The part in the valley represents remnants of a late antique (Gothic) castrum. Although slightly irregular in shape, this part follows the plan of a Roman military camp, with gates towards the north, east and south. Later, medieval and Turkish reconstructions were done in the upper part (on the hill), which represented a separate fortified entity. Within this complex, three objects of the Gothic castrum have survived: an octagonal tower at the end of the north wall of the castrum, and two rectangular towers in the central part of the former western wall.