Himyar was appointed to the Yemen by al-Mutawakkil in 847, following the departure of Ja'far ibn Dinar al-Khayyat from the province. He was quickly forced to confront the Yu'firids, whose rebellion had already consumed the Yemeni highlands for over a decade, but was defeated in battle and forced to flee. Himyar then departed from the Yemen, allowing the Yu'firids to enter the chief city of Sana'a and occupy much of the country between Sana'a and al-Janad.[1]