The Rasulid Dynasty was established in 1229 by Umar ibn Rasul, who was appointed deputy governor by the Ayyubids in 1223. When the last Ayyubid ruler left Yemen in 1229, Umar stayed in the country as caretaker. He subsequently declared himself an independent king by assuming the title "al-Malik Al-Mansur" (the king assisted by Allah). Umar established the Rasulid dynasty on a firm foundation and expanded its territory to include the area from Dhofar to Mecca