Another reason why it was allowed for the church to be built, which was forbidden by the Ottomans at the time, was the political and social situation after the 1718 Treaty of Passarowitz. Signed by the Ottoman Turkey on one, and Austrian Empire [and Venetian Republic] on the other side, it ended the Austro-Turkish war of 1716-1718 and Ottoman-Venetian war of 1714-1718. The treaty confirmed the Austrian occupation of northern Serbia, setting the new Austrian-Ottoman border close to Užice, at Crnokosa mountain, near Kosjerić. Fearing the Austrian policy of uniatism, some Orthodox Serbs fled into the Serbian regions which remained under the Ottoman rule. The border close to Užice was said to be "flooded" by the migrants, so the local Ottomans granted them certain privileges in order to populate the frontier areas, including the construction of the church.