Sultan Ahmed Jalayir took refuge with the Nasir-ad-Din Faraj the Sultan of Mamluk Egypt, but he imprisoned him out of fear of Timur. In 1403 the Timurids defeated Qara Yusuf at the Battle of Algami Canal and drove him out of Baghdad again, also killing his brother Yar Ali[1] which made him to seek asylum in Damascus, which was then ruled by Mamelukes.[6]