The great Serbian migration took place in early 1690, during the Great Habsburg-Ottoman War, which ended a few years later by the Karlovac Treaty. The Austrian army was successful, liberating Hungary and Serbia, reaching Macedonia. The Serbs organised an uprising and entered the war on the Austrian side. But France attacked, the Austrian army had to retreat from the Balkans. In its wake, 40,000 Serbs, lead by Patriarch Arsenije III Čarnojević, fearing Turkish retaliation, left Serbia. Directly before crossing the border, the Serbs held an assembly of both the Church and lay leaders, agreeing on the requests to be put to the Austrian emperor. Leopold I issued an edict permitting the serbs to settle, guaranteeing them special church and school privileges, provided they would become Austrian soldiers. Thus the edict legalised the position of the Serbs in Hungary.
Emperor Leopold allowed the Serbs to settle in the regions towards Buda (an old city, part of the present Budapest) and Komoran, almost 400 km from the border. Serbs had already had their settlement around Buda. After the Great Migration, the Serbes settled in Taban, Ostrogon and St Andrea, where they still live today.
Arsenije III Čarnojević, Bishop Isaija Đaković.