Egypt was under the rule of a Mamluk Sultanate led by Circassians and Kipchak Turks, and who also ruled Syria, Palestine, Lebanon and Jordan. After Mehmed II (the Conqueror) united most of Anatolia under Ottoman rule, the two empires became neighbours of each other where two Mamluk vassals of Turkmen origin were the buffer states between the two. During the Ottoman-Safavid Persia war, Mamluks (or their vassals) supported Persia. Selim I (the Grim) of the Ottoman Empire used this claim as a pretext to wage a war on Mamluks. During Selim’s long campaign to Egypt in 1516-18, Mamluks were defeated three times; in the battles Marj Dabiq and Yaunis Khan on the way to Egypt and in the Battle of Ridanieh in Egypt (The first and the third personally commanded by Selim and the second by Hadim Sinan Pasha), the grand vizier. The third battle in which Hadim Sinan Pasha fell was the final blow to Mamluks. After clashes in Cairo, the Mamluk sultan Tumanbay II was arrested and Selim annexed the whole Mamluk territory, enlarging the Ottoman Empire more than two times in only two years.Agaston-Masters, p.512Jorga Vol 2, p.284-286
