The various Bayajida legends in Hausa folklore describe how Bayajida, son of the king of Baghdad, came to Bornu and married the ruler's daughter. He later fled and came to Daura, fathering the founders of the seven Hausa states. The legends seem to be describing events which happened during the tenth century A.D. and Bayajida may be identical with the Ibāḍite sectary Abū Yazīd who resisted the Fāṭimids of Tunisia until he was killed by them in 947. The debris of his army may have fled across the Sahara and arrived in Bornu, then north of Lake Chad. After some time a part of this rabble which had remained unassimilated moved south-west and interbred with the indigenous inhabitants round Daura, forming the Hausa aristocracies. Different ingredients of the legends may be folk memories of events near Mecca, Berber myths of origin and perhaps Greek mythology, as well as accounting for the introduction of horses and the sinking of wells in rock by the incoming Berbers.