 Amidst the struggle for power between Uzun Hasan's grandsons Baysungur (son of Yaqub) and Rustam (son of Maqsud), their cousin Ahmed Bey appeared on the stage.Ahmed Bey was the son of Uzun Hasan's eldest son Uğurlu Muhammad, who, in 1475, escaped to the Ottoman Empire, where the sultan, Mehmed the Conqueror, received Uğurlu Muhammad with kindness and gave him his daughter in marriage, of whom Ahmed Bey was born.According to Hasan Rumlu's "Ahsan al-tavarikh", in 1496-7, Hasan Ali Tarkhani went to the Ottoman Empire to tell Sultan Bayezid II that Azerbaijan and Persian Iraq were defenceless and suggested that Ahmed Bey, heir to that kingdom, should be sent there with Ottoman troops.