To please the Caliph and secure his recognition, Aybak announced that he was merely a representative of the Abbasid Caliph in Baghdad. To placate the Ayyubids in Syria the Mamluks nominated an Ayyubid child named al-Sharaf Musa as a co-sultan. But this did not satisfy the Ayyubids and armed conflicts between the Mamluks and the Ayyubids broke out. The Caliph in Baghdad, preoccupied with the Mongols who were raiding territories not far from his capital, preferred to see the matter settled peacefully between the Mamluks in Egypt and the Ayyubids in Syria. Through negotiation and mediation of the Caliph that followed the bloody conflict, the Mamluks who manifested military superiority reached an agreement with the Ayyubids that gave them control over southern Palestine including Gaza and Jerusalem and the Syrian coast. By this agreement the Mamluks not only added new territories to their dominion but also gained recognition for their new state.