The arrival of the Avars in these areas is closely related to the immigration of the Slavs. The battles of the Avars, Franks and Bulgarians take place here. There is almost no information about the Slavic states from this period.

At the end of the 9th century, the Hungarians came to this area and ruled and fought with the Serbs for a long time. Around 960. In the war against the Hungarians, the Serbian prince Časlav was executed at Battle. For a short time (976 – 1017), the Macedonian emperor Samuilo ruled here, and after that, Byzantium and the Hungarians, who in 1072, fought for Mačva. year prodrlikak to Niš. In 1247 The Hungarians established the Macva banovina here, which was much smaller than Macva today, and got its name from the area – the town of Macva, whose location has not been determined with certainty even today. The management of the banovina was entrusted by the Hungarian king Bela IV to Rostislav Mihailoviđa, a fugitive Russian prince. Serbian king Uroš I in 1268. led fierce battles with the Hungarians for the Sword.

After 1282 King Dragutin received the administration of Mačva from the Hungarians. After his death in 1316 He was succeeded by his son Vladislav II, who was removed by his uncle Milutin. King Charles I Robert of Hungary in 1320. takes Mačva. Emperor Dušan tried several times to conquer Mačva, but without success. It was not until Prince Lazar Hrebeljanovic captured Mačva in 1381. According to the charter from the Ravanica monastery in Mačva, which was called Bitva, after the settlement of the same name, 16 settlements are mentioned. Prince Lazar fights for these spaces with variable success. The Turks invaded Mačva for the first time in 1391.