Jedan od rijetkih ravničarskih srednjovjekovnih gradova , u historijskim izvorima se prvi put spominje 1091. godine pod nazivom Otok sv. Vladislava, a pod nazivom Bihać 1260. godine. Samo dvije godine kasnije, 1262. godine, ugarski kralj Bela IV , preko kraljice Marije, uzdiže ga na položaj slobodne kraljevske varoši. Civitas Byhyg, kako se u XIV stoljeću obično naziva ovaj grad, jedan je od rijetkih koji je sačuvao kontinuitet kraljevske slobode sve do XV stoljeća. Privrženost Bišćana, a i vlastite interese u ovom gradu, kraljevska vlast nastoji osigurati potvrđivanjem Marijina privilegija iz 1262. godine: 1279, 1322, 1326, 1345, i 1358. godine. Na čelu grada stoji villicus , a čija je osnovna funkcija bila sudstvo. Sudske ovlasti villicusa obuhvatale su i najteže sporove u kojima se radilo o prolivenoj, a slijedeća žalbena instanca je bio kraljevski sud. Uz njega postoji i određeni oblik gradskog vijeća, tijela koje sačinjavaju građani pod zakletvom, jurati.
U drugoj polovini XIV stoljeća, kada je došlo do ustanka ugarsko-hrvatskih velikaša 1384. i sukoba s Bosancima 1387, Bihać je došao pod bosansku vlast 1398, i ostao pod tom vlašću do 1404. godine. Naredne 1405. godine ugarski ga je kralj Sigismund založio zagrebačkom županu Pavlu Čuporu,a 1426. godine prodao Frankopanima. Poslije pojave osmanske opasnosti na istoku, Bihać opet dolazi pod kraljevsku vlast i kao ključ obrane južne Hrvatske u drugoj polovini XVI stoljeća postaje centar vojnički organizirane obrambene jedinice kapetanijskog tipa.
Po dolasku pod osmansku vlast 1592. godine Bihać je postao sjedište Bihaćke kapetanije, kadiluka , a od 1616. godine i Bihaćkog sandžaka. Tvrđava je popravljena i proširena, popravljene su okolne kule, iskopani novi i očišćeni stari šarampovi i napravljene dodatne tabije da bi se mogla smjestiti obrambena artiljerija. Prema historijskim izvorima, bihaćka tvrđava je bila kvadratnog oblika, opasana dvostrukim bedemima. Visina vanjskog zida bila je 2, a širina 3,5 hvata. Za razliku od vanjskih, unutrašnji bedemi bili su visoki 4 , a široki od 1 do 4 hvata. Tvrđava je imala 3 ulaza, vrata su bila od hrastovine, a s vanjske strane bila su okovana gvožđem. Oko nje je s tri strane bio dubok opkop s vodom, a sa četvrte je tekla Una. Širina opkopa bila je 4, a dubina od 1,5 do 2 kojih se mogao pružiti otpor, kao i devet kamenih utvrda, tabija, gdje su postavljeni topovi.
Bihaćka tvrđava kao „bedem na granici“ i „ključ Bosne“, bila je jedna od najvećih i najvažnijih utvrda Bosanskog ejaleta i nabolje čuvana u krajiškoj zoni tokom cijele osmanske uprave. Po popisu graničnih tvrđava iz 1616. imala je 638 nefera, po popisu iz 16434. – 828 nefera, a u prvoj polovini XVII stoljeća – 1327 nefera. S ovim snagama čuvana su četiri punkta: tvrđava, kula tvrđavskog mosta, karaula – prolaz i palanka. Strategijski najvažniji punkt bila je kula tvrđavskog mosta, gdje je sjedio kapetan Bihaćke kapetanije. Do 1878. godine u toku Bečkog rata, ali nikada nije zauzet. Deset godina nakon austrougarske okupacije, 1888. godine tvrđava je porušena i grad je potpuno uključen u urbano tkivo savremenog gradskog naselja.
Bihać is one of the rare medieval plain towns. By the sources for the first time it was mentioned in year 1091 under the name „ Island of St. Vladlislav“ and in 1260 under the name Bihać. Only two years later, in 1262, the Hungarian King Bela IV, by the queen Maria, put sit in the position of free royal town.
„Civitas Byhyg“, as this town was called in the 14th century, is one of the rare that has maintained the continuity of royal freedom until the 15th century. The devotion of its inhabitants and its own interests in this townthe throne tried to insure by regular confirming of Maria“s privilege form 1262, 1279, 1322, 1326, 1345, and 1358. The Head of the town was villicius whose main function was judiciary. Under the authority of villicus were een the hardest disputes about spilled blood. The next station for appeeals was the Royal Court. Beside it, there was a kind of city council-the legislative body formed by citizens under the Oath. They were called Jurati.
In the second half fof 14th Century, in time of uprising of Hungarian-Croatian Aristocracy in 1384 and clash with Bosnians in 1387, Bihać came under the Bosnian rule in 1398 and stood under that conditions till 1404. Next year Hungarian king Sigismund pawned it to the Zagrebs district prefect Pavao Čupor, and in 1426 he sold it to the Frankopans. After the appearance of the danger by Turks on the east, Bihać came under the royal authority again and as the key of the defense of the south Croatia in secund half of the 16th century it became organized military force center of the captaincy type.
As it fell under the Turkish authority in 1592, Bihać became headquarters of captaincy of Bihać, of quadi district, and in 1616 even of Sanjak of Bihać. The fortress was rebuilt and enlarged, towers around were repaired, the new sharampoes were dug and the old ones were celared. New trenches were made for defensive artillery. By the sources thee fortress of Bihać had a square shape with double ramparts. The outside wall had 2 cords in height and 3.5 cords in width. The fortress had three portals with doors made of oak wood and shackled with iron form the outside. Around the fortress from three different sides there were trenches with water and from the fourth side flew Una water. Width of the trench was 4 and height 1.5 to cords. The fortress had four towers fort greater defense and nine places made of rocks (tabija) with cannons.
The fortress of Bihać as „The Rampart on Border“ and „Key of Bosnia“ was one of the greatest and most important fortresses of bosnian ejalet and most protected in Krajina area through the Turkish period. By the official list of fortressesfrom 1616 it had 638 soldiers, from 1643, 828, soldiers and in the first half of the 17th century 1327 soldiers. With theses forces four positions were defended: fortress, the tower on the fortress bridge, watchtower passage and province. From the strategy sight the most important was the tower on the bridhe where was settled the captain of Bihać captaincy. Till 1878 it went under five huge sieges and the biggest siege happened in the 1697 in time of Vienna war. But it was never taken. Ten years after the Austrian-Hungarian occupation in 1888, the fortress was crashed and the town joined urban area.