at the Battle of Bliska in 1322, after which the Angevin king Charles Robert arrived in the city and imprisoned the former lord Mladen II Šubić of Bribir. Upon the departure of the king to Hungary, the noble Ivan Nelipić quickly seized Knin, and from there expelled the king's men from Croatia. Thus, these territories de facto continued to remain outside the monarchy, and the Nelipić noble family made Knin their permanent seat and ruled their territories as "Princes of Knin". After successfully warring against their enemies, the Dalmatian cities and nobility under Juraj II Šubić of Bribir (who was imprisoned in the castle's dungeons), as well as the royal forces commanded by the Slavonian ban Mikac Prodanić, their rule came to an end when Louis I of Hungary personally led an army to re-establish royal power over Knin in 1345. During this time it became known that the castle consisted of two major parts, administered by two castellans and which was populated by houses and baths, a palace with a main hall used previously by the Nelipić's to sign an alliance with the Republic of Venice and to enforce customs on imports to the city. An annual trade fair, on Saint Bartholomew's day is known to have taken place in the settlement below since at least the 1360s and was regularly attended by the merchants from the Dalmatian cities. It is known that Knin's also burg housed a significant colony of merchants originating from these cities which also gives insight into its commercial importance. A supreme judicial body for the whole of Croatia was formed, composed of Croatian nobility, and was located on the castle grounds. A chapel dedicated to Saint Bartholomew located within the cathedral was the place of notary of the Knin See. There the noble Ivan Nelipić (son of Vladislava) had reaffirmed his rights to the estates and lands in Cetina during his stay in the city. Using the dynastic instability in the neighboring lands, the city came into the hands of the Bosnian king Tvrtko I during the year of 1388. The previous bishop had likely been expelled, where the Ragusan Mihailo took his place, and was also given the office of the king's chancellor. These actions provoked a retaliation of king Sigismund, whose armies besieged Knin in September 1390. The city, along with other territories were returned to Sigismund in 1393. Upon his return