Siege of Sokolac

The siege of Sokolac was a siege of Sokolac Castle in Brinje, Kingdom of Croatia, in August 1493, by the joint bans of Croatia John Both de Bajna and Emerik Derenčin, against the Frankopan family, due to the Frankopans' attempt to regain control over the town of Senj. John Both was killed during the siege, and it was eventually abandoned after Derenčin received news of an approaching Ottoman army. The two sides made truce, and fought the Ottomans together at the Battle of Krbava Field the following month.

Background
After the death of Hungarian king Matthias Corvinus, Frankopan noble family attempted reassert their control over the town of Senj. Hungarian king earlier confiscated this town from them in order to form Senj capitancy whose objective was to defend the region from both Ottomans and the Venice. In spite of Frankopan's attempts take te city, the citizens of Senj themselves did not want to come under Frankopan rule, for which they complained to pope, as well as the king, who promised them help. Emerik Derenčin and Ivan Both were soon appointed bans of Croatia, with task of deterring Frankopans from taking Senj.

Siege
Upon learning that ban's army is on its way to relieve Senj, Frankopans cancelled their attempts to take Senj and withdrew to their castle of Sokolac. Two Croatian bans came after them to Sokolac. As bans were inspecting around castle to find the weakspots in its walls, Both approached too close to the castle walls and got struck by a gunfire which killed him. Both's death enraged other commanders, who decided to undertake much larger siege and ordered construction of siege engines.

Leaving the siege
In the meantime, Derenčin received information that Ottoman army entered Croatian lands. Ottoman sources also claim that Anž Frankopan invited Ottomans to Croatia, because ban's army ravaged his possessions. Derenčin therefore quickly made peace with most of the Frankopans (except for Anž Frankopan), so they could together confront the Ottoman army. The events that followed led to the Battle of Krbava field.