The Alaouite Dynasty is the name of the current Moroccan royal family. The name Alaouite comes from the ‘Alī of its founder Moulay Ali Cherif who became Prince of Tafilalt in 1631. His son Mulay Al-Rashid (1664–1672) was able to unite and pacify the country. The Alaouite family claim descent from Muhammad through the line of Fāṭimah az-Zahrah, Muhammad's daughter, and her husband, the Fourth Caliph ‘Alī ibn Abī Ṭālib.
According to some legends the Alaouites entered Morocco at the end of the 13th century when Al Hassan Addakhil, who lived then in the town of Yanbu in the Hejaz, was brought to Morocco by the inhabitants of Tafilalet to be their imām. They were hoping that, as he was a descendant of Muhammad, his presence would help to improve their date palm crops thanks to his barakah "blessing", an Arabic term meaning a sense of divine presence or charisma. His descendants began to increase their power in southern Morocco after the death of the Saʻdī ruler Ahmad al-Mansur (1578–1603). In 1669, the last Saʻdī sultan was overthrown in the conquest of Marrakesh by Mulay r-Rshid (1664–1672). After the victory over the zāwiya of Dila, who controlled northern Morocco, he was able to unite and pacify the country.