In the First Serb Uprising, "Hajduk" Veljko Petrović liberated the area from Ottoman rule in 1806. The Ottomans retook the area in 1813 but finally ceded it to Serbia in 1833.