Blagaj is a village-town in the south-eastern region of the Mostar basin, in the Herzegovina-Neretva Canton of Bosnia and Herzegovina. It stands at the edge of Bišće plain and is one of the most valuable mixed urban and rural structures in Bosnia and Herzegovina, distinguished from other similar structures in its urban layout. Blagaj was most likely named for its mild weather patterns since blaga in Bosnian means "mild". Blagaj is situated at the spring of the Buna river and a historical tekke (tekija or Dervish monastery). The Blagaj Tekija was built around 1520, with elements of Ottoman architecture and Mediterranean style and is considered a national monument. Blagaj Tekke is a monastery built for the Dervish.
Vrelo Bune, the source of the Buna river, is a strong karstic spring. The river flows west for approximately 9 kilometres (6 mi) and joins the Neretva near the village Buna. The historic site of the Blagaj Fort (also Stjepan-grad or Stipan-grad), on the hill above Blagaj, was the seat of Grand Duke of Bosnia, Stjepan Vukčić, and the birthplace of Bosnian queen Katarina Kosača-Kotromanić.
During the classical antiquity there existed an Illyrian fortress and a Roman castrum. During the reign of Byzantine Emperor Justinian, several fortified towns were built in the area. 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. In the 14th century, during the reign of Bosnian Ban Stjepan II Kotromanić, Hum became part of the Bosnian state. In the 15th century Sandalj Hranić Kosača and his nephew Stephen Vukčić Kosača ruled the Hum and Blagaj territory until the arrival of the Ottomans in 1466. Blagaj is also known as a residential area of Bosnian rulers and particularly of royal families Hranić and Kosača.
In historical sources Blagaj was first mentioned in 1423. During the period of the Ottoman Empire, Blagaj was the seat of the Blagaj Vilayet, and was divided into several neighborhoods. 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. Bosniaks were majority until 1835, during the Austro-Hungarian period Christians constituted twice as many. An Orthodox Church was built in 1893 and a Roman Catholic church in 1908.
The earliest Blagaj settlement was located at the foot of the Blagaj fort, where the road runs down from the fort and intersects with the Nevesinje road. There was too little trade for a commercial centre to emerge and in an agricultural environment of this kind the circumstances did not give rise to an urban settlement. The urbanization of the area (in the form we know today) was defined in the second half of the 15th century, and its structure was shaped during the 16th century.
Historical sources frequently refer to mediaeval fortress Blagaj Fort (Stjepan grad) as a distinct territorial entity. During the Ottoman period construction of buildings was initiated in the fortress outskirts (houses and public edifices. The residential areas were formed as urban quarters or mahalas, with buildings facing inwards - onto their courtyards. Resident complexes display evidence of a high standard of living and the Velagić house complex is one of the most valuable of this type in Herzegovina. The town mostly developed along the right bank of river Buna because the left bank is somewhat steeper and less suitable for construction.
Public buildings were positioned quite deliberately within the urban structure as a whole. Among the first edifices was the Careva (Imperial) mosque constructed in 1521, which helped the settlement acquire the status of kasaba. It was followed by the construction of Karađoz-beg bridge from 1570 and then the Leho bridge. Using bold structural solutions played a vital role in architecture of Blagaj: addition of pillars and vaults, along with other structural elements, is quite evident. 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.