While the Rasulids controlled most of Yemen, followed by their successors the Tahirids, Sanaa largely remained in the political orbit of the Zaydi imams from 1323 to 1454 and outside the former two dynasties' rule. The Mamelukes arrived in Yemen in 1517.