The Battle of Algami Canal was fought between Kara Koyunlu under their Bey, Qara Yusuf and the Timurid Empire under the leadership of Timur's grandson Abu Bakr bin Miran Shah for control of Baghdad and therefore Iraq in late 1402.