This was ideal to survive since it is located on a steep hill.
Irony how castles and forts are considered obsolete in modern warfare but against a human-wave enemy, it would hold out.
Wikipedia says this of Blagaj Fortress:
Unlike other fortifications that were also rulers’ residences in
Bosnia and Herzegovina, the Blagaj fort is on a naturally flat site above vertical cliffs to the south, west and north. The ground plan of the fort is an irregular polygon adapted to the configuration of the terrain. The approach route, a steep serpentine bridle path 2 metres (7 ft) wide and 900 metres (3,000 ft) long, leads to the entrance in the thickest (east) wall of the forecourt. The walls of 12 or 14 metres (39 or 46 ft) in height have remained largely preserved, and range in thickness from 1.5 to 2.0 metres (4.9 to 6.6 ft), while on the south they are no thicker than 1.5 metres (4.9 ft). The inner defended space is a relatively small area of about 1,700 square metres (18,000 sq ft), similar to the Jajce fort.
The entrance to the fortified town was protected by an outer forecourt that is now hard to discern, a forecourt (VII, measuring 10 x 11.5 m) and a gatehouse (VII, measuring 10 x 7 m) as the final obstacle to attackers. The walls of the gatehouse are noticeably more solid and higher than those of the forecourt.
In the 6th century, most of the walls were increased in height although their dimensions remained the same. During the
medieval period the entire mass was considerably increased by these additions, and it is not impossible that some of the lower parts of the tower collapsed. The
breastworks may not have been built up fully to their original height, but somewhat lower (Basler, 1983, 32). In the late 14th and early 15th century, the walls were reinforced and thickened. About ten meters from the fort yet another wall was added giving that space the impression of a trench. The east wall was badly damaged in the 18th or early 19th century when a large quantity of gunpowder exploded in its middle tower. Repairs were carried out rather clumsily and considerably altered the original appearance (Basler, 1983). Anđelić, who carried out excavations in 1965, writes: “As a detailed result of the excavations, it turned out that the fort had no remains of antique or late antique architecture” (Anđelić, 1965, 179).
Among the architectural features discovered, the most significant were the remains of a palace (XV), of irregular rectangular outline.
A comparison of the walls' structure enables one to track the various stages of construction and repair - from the earliest beginnings of the fort in the fourth century. The walls of the first stage of construction are of quarry stone laid in horizontal layers (
opus incertum), similar to the palace in
Mogorjelo. In the second stage, which lasted between 535 and 600, the walls were repaired and in places built up to a height of 1 to 3 metres (3.3 to 9.8 ft), using the technique of stone laid slantwise (
opus spicatum). This construction technique is associated with the reign of the
Emperor Justinian (527–565). Repairs to the central tower of the east wall date to the 6th century. The type and extent of the interventions dating from the 7th to the 15th century are hard to determine because of later repairs, conducted in opus incertum up to the 19th century. After the 16th century, all works on the fort were carried out by local 'dunđeri' (all-round builders who would turn their hand equally to masonry or carpentry), which is ascribed to the abrupt decline in the strategic importance of the fort in the circumstances of the day.