At the end of the 14th century, the Ottoman Empire conquered most of the Balkans and arrived to the southern borders of the Kingdom of Hungary. After the Battle of Kosovo (1389), Serbia was threatened by the Ottomans. Therefore, in 1426 Stefan Lazarević, the Serbian despot, made an agreement with the Hungarian King, Sigismund of Luxemburg: the fortresses of Belgrade and Golubac were assigned to Hungary in exchange for Sigismund's protection of Serbia and his recognition of Đurađ Branković as the successor of despot Stefan.