The Alaouite dynasty, or Alawite dynasty, is the current Moroccan royal family. Sharif ibn Ali became Prince of Tafilalt in 1631. His son Mulay Al-Rashid (1664–1672) was able to unite and pacify the country. During the reigns of Muhammad IV (1859–1873) and Hassan I (1873–1894), the Alaouites tried to foster trading links, above all with European countries and the United States. The army and administration were also modernised to improve control over the Berber and Bedouin tribes. With the war against Spain (1859–1860) came direct involvement in European affairs. Although the independence of Morocco was guaranteed at the Treaty of Madrid (1880), the French gained ever greater influence. German attempts to counter this growing influence led to the First Moroccan Crisis of 1905–1906 and the Second Moroccan Crisis of 1911.

More Info: en.wikipedia.org