The town of Maglaj was built on high magmatic cliff in a dominant position that falls steeply towards the right bank of the Bosna River. The natural complex on which the town is positioned is located on Mount Ozren’s slopes, separated by a valley. The origin of the toponym Maglaj is usually associated with a natural phenomenon – fog, which is otherwise very common in this area, however, more imaginative interpretations attribute the name of the town and thus its origin to the ancient Illyrian tribe of the Mezei. Although tempting, such interpretations cannot withstand serious linguistic and topographical scrutiny. As a well-fortified town, Maglaj was well adapted to the terrain with strong ramparts and towers and a prominent location, which offered the nobles and defenders of the town adequate protection and security. Maglaj, as well as the surrounding area that entered its orbit, was part of Usora, one of the Bosnian regions, even though the structure of this area in a narrow administrative understanding, where the existence of a particular county is understood, is insufficiently known. It is assumed that a county with an unknown name existed here from the earliest times, roughly corresponding to the present-day municipalities of Žepče, Zavidovići and Maglaj. By drawing analogies with the Ottoman administrative organization, which is generally believed to have followed medieval territorial-political units, it was assumed that the county would be referred to as Maglaj and the town of Maglaj would serve as the county’s most important political and military center. Nothing is known about the feudal magnates who ruled this part of Usora, it is commonly believed that they were the Zlatonosović family, otherwise traditional nobles of this area whose members bore the title of Duke of Usora. On January 15, 1399, King Stjepan Ostoja, surrounded by the most prominent Bosnian noblemen of the time, issued a charter to the Ragusans in “Lišnica”, which is related to the Liješnica river, which flows near Maglaj.
In written sources, the Hungarians are also mentioned as the rulers of Maglaj, during whose presence the first written trace of the town appears. It refers to King Sigismund’s campaign in Bosnia in 1408, which was remembered for the catastrophic defeat of the Bosnian army, but also for the brutal revenge of the Hungarian side on the captured Bosnian noble who, according to the testimony of Sigismund’s biographer Windecke, was brutally executed in Dobor. The Hungarian attack on the Bosnian borders, which began in September 1408, took place along the Bosna river valley, and Maglaj was attacked, where the Hungarian king stayed from September 18 to 21, probably setting up his camp at the foot of the town. There, King Sigismund issued the charter (sub castro nostro Magday vocato) which represents the last surviving reference to Maglaj in historical sources until the Ottoman conquests. In the aftermath of a great victory over the Bosnian army, which most likely took place south of Maglaj, the Hungarian detachments retreated across the Sava, stopping briefly in Dobor, where the massacre of Bosnian nobles was allegedly committed. It is likely that the town of Maglaj was under the control of the Hungarian king after 1408 when it was incorporated into the newly established Usora Banate. However, it remains unclear whether Bosnian rule was re-established in the following period. This is all that is known about Maglaj’s medieval history with the exception that it remains unknown whether a sub-town was established at its foot. Under Ottoman rule, Maglaj appears for the first time in the 1485 census, where the nahiya Maglaj is mentioned. It is unclear when the town came under Ottoman control. In the census of 1468, it is not mentioned.
In the 15th century, when Maglaj first appeared in historical sources, it was a castle built in the late Gothic style, and it was extremely well fortified. Due to the intensified use of firearms, the town was further strengthened over time. The town complex consists of the main fortress, the sub-town and the vestibule. The main fort is surrounded by ramparts on two long sides, while the other two sides are closed by two polygonal towers of different sizes, one of which represents the main defense tower and dominates the entire town with its massiveness. A special rampart separates the second tower from the rest of the town. As a result of the intervention of Ottoman builders during the 17th and 18th centuries, the walls of the town were strengthened, cannon positions were created and a clock tower was constructed, along with a courtyard around it. Initially, the town entrance was located in the west, but it was shifted to the north during the Ottoman period.
- Anđelić, Pavao: “O usorskim vojvodama i političkom statusu Usore u srednjem vijeku”, Prilozi Instituta za istoriju, no. 13, Sarajevo, 1977, 17-45.
- Bojanovski, Ivo: “Stari grad Maglaj: istraživački i konzervatorski radovi 1962. i 1963. g.”, Naše starine, no. 10, Sarajevo, 1965, 61-97.
- Ćirković, Sima: Istorija srednjovekovne bosanske države, SKZ, Beograd, 1964.
- Detelić, Mirjana: Epski gradovi: leksikon, Balkanološki institut SANU (Posebna izdanja 84), Beograd, 2007.
- Engel, Pál: “Neki problemi bosansko-ugarskih odnosa”, Zbornik odsjeka za povijesne i društvene znanosti HAZU, no. 16, Zagreb, 1998, 57-72.
- Glavaš, Tihomir: “Maglaj”, in: Arheološki leksikon BiH, II, (ed. Borivoj Čović), Zemaljski muzej BiH, Sarajevo, 1988, 120.
- Handžić, Adem: Tuzla i njena okolina u XVI vijeku, Svjetlost, Sarajevo, 1975.
- Jelić, Luka: “Najstariji kartografski spomenik o rimskoj pokrajini Dalmaciji”, Glasnik Zemaljskog muzeja, br. 10/4, Sarajevo, 1898, 531-559.
- Kovačević Kojić, Desanka: Gradska naselja srednjovjekovne bosanske države, Veselin Masleša, Sarajevo, 1978.
- Kreševljaković, Hamdija: “Stari bosanski gradovi”, Naše starine, br. 1, Sarajevo, 1953, 7-44.
- Lovrenović, Dubravko: Na klizištu povijesti (sveta kruna ugarska i sveta kruna bosanska) 1387-1463, Synopsis, Zagreb-Sarajevo, 2006.
- Mihályi, János: Máramarosi diplomák a XIV. és XV. századból., Mayer és Berger, Máramaros-Sziget, 1900.
- Mrgić, Jelena: Severna Bosna 13-16. vek, Istorijski institut (Posebna izdanja 55), Beograd, 2008.
- Popović, Marko: “Srednjovekovne tvrđave u Bosni i Hercegovini”, in: Zbornik za istoriju BiH I, (ed. Milorad Ekmečić), SANU (Odbor za istoriju Bosne i Hercegovine, Knjiga 1), Beograd, 1995, 33-55.
- Redžić, Husref: Srednjovjekovni gradovi u Bosni i Hercegovini, Sarajevo Publishing, Sarajevo, 2009.
- Stojanović, Ljubomir: Stare srpske povelje i pisma I/1, SKA, Beograd-Sremski Karlovci, 1929.
- Šabanović, Hazim: Bosanski pašaluk, Svjetlost, Sarajevo, 1982.
- Šišić, Ferdo: Vojvoda Hrvoje Vukčić Hrvatinić i njegovo doba, MH, Zagreb, 1902.
- Vego, Marko: Naselja bosanske srednjevjekovne države, Svjetlost, Sarajevo, 1957.
- Živković, Pavao: “Usora i Soli – poprište značajnijih historijskih događaja u XIV i XV stoljeću”, Članci i građa za kulturnu istoriju istočne Bosne, no. 15, Tuzla, 1984, 33-45.