Towards the end of the 17th century, the Turks suffered their first major defeat near Vienna in 1683. and at Buda in 1686. years. After that, they return their territories in Slavonia, Vojvodina and Bosnia, so that on the 6th September 1688 first occupied Belgrade, and after seven days also Šabac, which was the strongest Turkish fortress in Serbia. The penetration of the Austrians further into Serbia and the conquest of Niš stopped the war with France.

However, Ludwig of Baden in 1689. in 2010, it passes through Niš, Leskovac, Vranje, Priština and reaches Veles in Macedonia. The Austrians suffered their first defeat in this campaign of conquest in 1690 near Kačanik and retreated even across the Sava and the Danube. The Serbian people retreated with the Austrian army – the Great Migration of Serbs under Arsenij Čarnojević, so that Serbia remains completely deserted. Mačva was the last to be abandoned and remained deserted, only after the Peace of Požarevac in 1718. began to be settled by the population from Herzegovina.

During the migration, the Serbs remained deep in Hungary, so that in 1710 in a record from Buda mentions a certain Simo Dimitrijević Crnobarac. A new war between Austria and Turkey begins in 1716. which ends with the victory of Austria, who rule Mačva until 1739. years. In addition to their army, the Austrians organized the Serbs within military districts – companies, whose centers were Crna Bara and Prnjavor. The company in Crna Bara was commanded by Captain Vuk Isaković and was deployed from Rača to Badovinci with 4 camps: Kordan, Crna Bara, Lazaret and Badovinci.

In order to protect against the plague, the Austrians established temporary sanitary institutions – infirmaries in Paraćin, Čačak and Crno Bara. The first census of settlements in the Šabac district was made by Colonel Naipert in 1718. years. The number of inhabitants is rapidly increasing with newcomers from Herzegovina and Montenegro. The levies on the people were high and were reduced thanks to the Montenegrin Vuk Isaković, who in 1735 became the commander of the Serbian hussar regiment.

In the census from 1735 4 churches are mentioned in Mačva: Church of St. Archangel Michael and Gavrila in the village of Drenovac, Church of St. Nikolaja in Bogatić, Church of St. Georgija in Crna Bara and the Church of St. Archpriests Mihajlo and Gavrilo in the trench Prnjavor. In 1737 Austria starts a war against the Turks in Serbia and Bosnia. Peace since 1739. In 1910, Macva was again won by the Turks. The nahija remains under the jurisdiction of the Šabac kadi. During and after the war, a large number of Mačvans fled across the Sava to Austria and even to Russia. There is written information that in 1757 around 1,000 families from Macva crossed the Sava and went to Mirgorod in Russia. The levies on the people were terrible.

In 1788, the Principality of Mačvan (Oberknez Uroš Drmanović from Bogatić) had 25 villages with 845 houses and 24 village princes: Tanabović, Pričinović, Drenovac, Orašac, Uzveće, Glušci, Noćaj, Zasavica, Banovo Polje, Metković, Bogatić, Klenje, Crna Bara, Badovinci, Begovci, Novo Selo, Prnjavor, Čokešina , Petkovica, Ribari, Petlovača, Glogovac, Lipolist, Sovljak, Skradjani, Bela Reka, Slepčević, Trnovito, Štitar and Motovilo. Crna Bara, Badovinci and Bogatić had the most 90 houses each.

Austria declared war on Turkey on the 9th. February 1788 year, but lost it after a lot of fighting around Belgrade, Šabac, Loznica and elsewhere, and the people in Mačva still remain under Turkish occupation. This time, the Turks are punishing the Serbs much more brutally, almost all of whom fought on the side of Austria in the last war.