 In 1277, Baybars launched an expedition against the Ilkhanids, routing them in Elbistan in Anatolia, before ultimately withdrawing to avoid overstretching their forces and risk being cut off from Syria by a second, large incoming Ilkhanid army.In July 1277, Baybars died en route to Damascus, and was succeeded by Barakah.However, the latter's ineptness precipitated a power struggle that ended with Qalawun being elected sultan in November 1279.