The first references to the name of Jajce in written sources is from the year 1396, but the fortress had already existed by then. Jajce was the residence of the last Bosnian king Stjepan Tomasevic; the Ottomans besieged the town and executed him, but held it only for six months, before the Hungarian King Matthias Corvinus seized it at the siege of Jajce and established the Banovina of Jajce.[3]:36