This treaty ended the hostilities of the five-year Austro-Russian–Turkish War (1735–39), in which the Habsburgs joined Imperial Russia in its fight against the Ottomans. Austria was defeated by the Turks at Grocka and signed a separate treaty in Belgrade with the Ottoman Empire on August 21, probably being alarmed at the prospect of Russian military success. With the Treaty of Belgrade, the Habsburgs ceded the Kingdom of Serbia with Belgrade, the southern part of the Banat of Temeswar and northern Bosnia to the Ottomans, and the Banat of Craiova (Oltenia), gained by the Treaty of Passarowitz in 1718, to Wallachia (an Ottoman subject), and set the demarcation line to the rivers Sava and Danube. The Habsburg withdrawal forced Russia to accept peace at the Russo-Turkish War, 1735-1739 with the Treaty of Niš, whereby it was allowed to build a port at Azov, gaining a foothold on the Black Sea.