 After Aybak learned that Aydughdi was plotting to topple him and recognize an-Nasir Yusuf as Ayyubid sultan, which would likely leave Aydughdi in virtual control of Egypt, Aybak had Aydughdi imprisoned in Alexandria in 1254 or 1255.Meanwhile, the Bahriyya faction in Gaza commanded by Baybars sought to enlist their services with an-Nasir Yusuf.In an attempt to dislodge Aybak, the Bahriyyah petitioned an-Nasir Yusuf to claim the Ayyubid throne and invade Egypt, but an-Nasir Yusuf initially refused.