However Ayyubid control was weak and power was usurped by their Turkish slaves , called mamelukes , who succeeded in founding a dynasty that lasted from 1251 to 1517 .
The dynasty lased until 1517 when Tut came in power .