As the entire Balkans became an integral part of the growing Ottoman Empire (a process that concluded with the fall of Constantinople to Sultan Mehmed the Conqueror in 1453), Wallachia became engaged in frequent confrontations in the final years of the reign of Mircea I (r. 1386–1418). Mircea initially defeated the Ottomans in several battles, including the Battle of Rovine in 1394, driving them away from Dobruja and briefly extending his rule to the Danube Delta, Dobruja and Silistra (c. 1400–1404). He swung between alliances with Sigismund, Holy Roman Emperor, and Jagiellon Poland (taking part in the Battle of Nicopolis), and accepted a peace treaty with the Ottomans in 1417, after Mehmed I took control of Turnu Măgurele and Giurgiu. The two ports remained part of the Ottoman state, with brief interruptions, until 1829. In 1418–1420, Michael I defeated the Ottomans in Severin, only to be killed in battle by the counter-offensive; in 1422, the danger was averted for a short while when Dan II inflicted a defeat on Murad II with the help of Pippo Spano.