The power of Timurids declined rapidly during the second half of the 15th century, largely due to the Timurid tradition of partitioning the empire. The Aq Qoyunlu conquered most of Iran from the Timurids, and by 1500, the divided and wartorn Timurid Empire had lost control of most of its territory, and in the following years was effectively pushed back on all fronts. Persia, the Caucasus, Mesopotamia, and Eastern Anatolia fell quickly to the Shiite Safavid Empire, secured by Shah Ismail I in the following decade. Much of the Central Asian lands was overrun by the Uzbeks of Muhammad Shaybani who conquered the key cities of Samarkand and Herat in 1505 and 1507, and who founded the Khanate of Bukhara. From Kabul, the Mughal Empire was established in 1526 by Babur, a descendant of Timur through his father and possibly a descendant of Genghis Khan through his mother. The dynasty he established is commonly known as the Mughal dynasty though it was directly inherited from the Timurids. By the 17th century, the Mughal Empire ruled most of India but eventually declined during the following century. The Timurid dynasty finally came to an end as the remaining nominal rule of the Mughals was abolished by the British Empire following the 1857 rebellion.