Blagaj was mentioned in Constantine Porphyrogenitus’ work De Administrando Imperio as Bona, then part of Zahumlje (Hum).
In the late 12th century, during the rule of Stefan Nemanja (Grand Principality of Serbia), prefect Jurko raised a church dedicated to saints Cosmas and Damian.
The city had seven mosques, two inns, four musafirhana (guest houses), a madrasa (Bosnian: medresa), two maktab, seven mills and four stone bridges on the river Buna.
Historical sources frequently refer to mediaeval fortress Blagaj Fort (Stjepan grad) as a distinct territorial entity.
Barrel vaults, which were common in mosques, the tekke and the hammam – were raised to a high degree of perfection and made an entirely free ground plan possible.
The synchronization of artisan crafts and construction techniques on the one hand and the development of the settlement on the other has left a mark on the Blagaj's image as a distinctive urban centre in Bosnia and Herzegovina.
During the reign of Austro-Hungarian Empire, Blagaj still retained its oriental-settlement character in its overall appearance as well as in its architectural and compositional details despite the obvious deterioration of the urban fabric.