Under the anti-Ottoman liberation struggle, in 1685, Croatian Ban Nikola III Erdődy issued a command to curtail the Ottoman army to the Una Valley. The Imperial Army liberated the area. The established conditions of power were confirmed by the 1699 Treaty of Karlowitz, thus the border was formally drawn to the Una Valley. The settlement of the Serbs in the area began in 1687. Ban Erdödy asked Bishop Martin Borković of Zagreb to settle Serbs at the Bishop's estates near Bović and Kirin.