From the times of King Matthias Corvinus a garrison was stationed in the city.[13] In 1528[14] Bihać became a center of a captaincy due to its position near the border with the Ottoman Empire and a relatively large number of residents. There were 25 forts under the command of the Bihać Captain in 1576. However, the number of forts was reduced to only three by 1579: Ripač, Sokol and Izačić.