and Hassan ibn Thabit at their courts. Early Islamic period Muslim conquest of Syria The nascent Muslim state in Medina, first under the Islamic prophet Muhammad (d. 632) and lastly under the second caliph, Umar (), made abortive attempts to contact or win over the Ghassan of Syria. The last phylarch of the Ghassan, Jabala ibn al-Ayham, stories of whom are shrouded in legend, led his tribesmen and those of Byzantium's other allied Arab tribes in the Byzantine army that was routed by the Muslims at the Battle of Yarmouk in . After supposedly embracing Islam, Jabala left the faith and ultimately withdrew with his tribesmen from Syria to Byzantine-held Anatolia in 639, by which time the Muslims had conquered most of Byzantine Syria. Unable to make headway with the Ghassan, the Muslim administration in Syria under its governor Mu'awiya succeeded in allying with the Ghassan's old-established Syrian allies, the Banu Kalb. The latter became the cornerstone of Mu'awiya's military power in Syria, and later, when he became head of the Syria-based Umayyad Caliphate in 661, of the Islamic empire in general. Umayyad and Abbasid periods Significant remnants of the Ghassan remained in Syria, residing in Damascus and the city's Ghouta countryside. At least nominally and probably gradually, many of these Ghassanids embraced Islam, especially under Mu'awiya's rule. According to the historian Nancy Khalek, they consequently became an "indispensable" group of Muslim society in early Islamic Syria. Mu'awiya actively sought the militarily and administratively experienced Syrian Christians, including the Ghassanids, and members of the tribe served him and later Umayyad caliphs as governors, commanders of the shurta (select troops), scribes, and chamberlains. Several descendants of the tribe's Tha'laba and Imru al-Qays branches are listed in the sources as Umayyad court poets, jurists, and officials in the eastern provinces of Khurasan, Adharbayjan and Armenia. When Mu'awiya's grandson, Caliph Mu'awiya II, died without a chosen successor amid the Second Muslim Civil War in 684, Umayyad rule was on the verge of collapse in Syria, having already collapsed throughout the caliphate, where the supporters of a rival caliph, the Mecca-based Ibn al-Zubayr, took charge. The Ghassan, along with their tribal allies in Syria, especially the Kalb, supported continued Umayyad rule to secure their interests under the dynasty, and nominated Mu'awiya's distant cousin, Marwan I, as caliph during a summit of the Syrian tribes in the old Ghassanid capital of Jabiya. Dahhak ibn Qays