Alawite ruler of Tafilalt from 1631–1636
Abul Amlak Moulay Sharif ibn 'Ali (; born c. 1589 – June 4, 1659) was an Arab Emir of Tafilalt from 1631 to 1636. He was a sharif whose family claimed to be descended from the Islamic prophet Muhammad through his grandson Hasan. Moulay Sharif is considered to be the founder of the Alaouite Dynasty of Morocco for being the father of Sidi Muhammad, Al-Rashid of Morocco, and Ismail Ibn Sharif.
Ancestry.
The Alaouites were a family of Sharifian religious notables ("shurafa" in Arabic) who claimed to be descended from Muhammad via his descendant Hasan, the son of Ali and Muhammad's daughter Fatimah. The family migrated from Hejaz, Arabia, to Tafilalt at around the 12th or 13th century in response to a request made by the locals who hoped that the presence of a Sharifian family would benefit the region. It is possible that the Alaouites were merely one of many Arab families who moved westwards to Morocco during this period. 
The Tafilalt was an oasis region in the Ziz Valley of eastern Morocco; its capital city is Sijilmasa, which is, historically, an important terminus of the trans-Saharan trade routes.
In the 13th century, Moulay Sharif's first ancestor, Moulay Hassan al-Dakhil, lived in Morocco after migrating from Hejaz. Moulay Sharif's family were the spiritual leaders of Sijilmasa. His fourth-degree ancestor, Moulay Youssef, succeeded his father Moulay Ali Cherif I at the head of the " zaouia". Historian Mohammed al-Ifrani quotes that the act which confirms this authority was, in the 17th century, in the hands of one of his great-grandchildren. Moulay Youssef's wife was Seyida (Lady in Arabic) Khalifa Tālākakīn al-Ṣanhājī of the Almoravid dynasty, he was also wedded to her sister Halima.
Biography.
Personality.
Since his teenage years, Moulay Sharif was reported to be a virtuous man. As an adult, he was trustworthy; people from Sijilmasa and the "Maghreb" (Morocco) would ask him for mediation practices.
Reign.
Moulay Sharif was born in 1589 as the eldest son of Moulay Ali Cherif. Before his proclamation, he was "Mukadam" ("General" in Arabic) in Sijilmasa and commanded troops. In 1631, Moulay Sharif was proclaimed Emir of Tafilalt by the people of Sijilmassa. Tafilalt is a region composed of ksours, or fortified villages, which all held equal status and traded with each other. Historians agree that Moulay Sharif did not conquer all ksours in Tafilalt, but was unanimously proclaimed Emir of Tafilalt as people regarded his prestigious sharifian lineage.
Moulay Sharif's rise to sovereignty took place when the power of the Saadi Sultanate was declining and multiple regional factions rebelled and fought for control of what is present-day Morocco. The most powerful faction among them were the Dilaites, a federation of Sanhaja Amazigh in the Middle Atlas who partly captured central Morocco at this time, reaching their utmost power in the 1640s when their leader Mohammed al-Hajj al-Dila'i conquered Fez and Salé. Another faction was led by Aboulhasen Ali ben Mohammed Essoussi Essemlali (commonly named Bou Hasen or Abu Hassun), who, initially serving the Saadians, had rebelled with his army and became leader of the Sous and the Draa River in 1614. Bou Hasen was a close friend of Moulay Sharif.
Conflict in Tabouasamt.
In 1633, the people of Tabouasamt rejected Moulay Sharif's authority. The town is surrounded by a citadel situated to the south of Sijilmasa. A great enmity existed between Moulay Sharif and the Beni Ezzoubir inhabitants of Tabouasamt. The latter were prideful of their citadel and wealth from commerce, which resulted in their rejection of any central authority from Sijilmasa. Moulay Sharif asked his friend Bou Hasen for help in the Tafilalt, while people from Tabouasamt recruited the Dilaites. Both responded by assembling two armies in Bou Hasen, and the Dilaites met in Sijilmasa. However, on July 8, 1633, the armies were asked to separate and stop fighting to avoid spilling the blood of Muslims.
When the people of Tabouasamt saw the friendship between Emir Moulay Sharif and Bou Hasen, they attempted to break that friendship. They would have their children serve Bou Hasen; as a result, Moulay Sharif and Bou Hasen ended their friendship. After people from Tabouasamt took their group and established Bou Bekr as Governor of Sijilmasa, it aligned with the peace treaty between Moulay Sharif and Tabouasamt. Bou Hasen went back to Sous afterwards.
Moulay Sharif's eldest son Sidi Mohammed, who knew about the plans carried out by the people of Tabouasamt against his father's authority, took the opportunity to retaliate. With 200 horsemen, he assaulted the citadel. Some of his men entered it, while others climbed the wall. Once they were inside, they massacred and slaughtered defenseless inhabitants. Sidi Mohammed and his men looted the citadel and captured Tabouasamt. Moulay Sharif was then informed of the capture of the citadel by his son; this act healed his heart of further revenge he was planning on them. After the capture of Tabouasamt, Moulay Sharif entered the citadel victorious, and a procession took place. Defeated, the Tabouasamt inhabitants recognized Moulay Sharif as their sovereign.
Bou Hasen was angry when he heard of the news and ordered his partisans from Sijilmassa to capture Moulay Sharif. Historian Mohammed al-Ifrani claims that Bou Hasen wanted to specifically capture Moulay Sharif and asked the Governor of Sijilmasa and his partisans to do so, with fellow historian Al Naciri supporting this. However, Al Zayani claims that Bou Hasen secretly told Tabouasamt's inhabitants to either capture Moulay Sharif or his eldest son Sidi Mohammed and that he was coming to Tabouasamt to take them home to Sous. Bou Hasen succeeded in his plan, and in both versions, Moulay Sharif was captured by treason and sent to Sous as a prisoner. The exact date of his capture is unknown; however, it happened shortly after the capture of Tabouasamt by Sidi Mohammed, which was from 1634 to 1635. 
It is also theorized that Moulay Sharif led an attack against Abu Hassun's garrison at Tabuasamt in 1635/1636 (1045 AH), but he failed to expel them. Abu Hassun forced him to go to Sous.
Captivity.
Bou Hasen kept Moulay Sharif inside a citadel. He would be released if a ransom was paid. Although Moulay Sharif was a captive of Bou Hasen, he was treated well. Bou Hasen gifted him a mulatto slave from the M'gharfa tribe, who later gave birth to one of his sons, Moulay Ismail.
In 1637 (1047 AH), Sidi Mohammed, upon amassing the huge ransom, Moulay Sharif went back home to Sijilmasa. While his father was a captive, his eldest son Sidi Mohammed (or Muhammad II) decided to become the "de facto" Emir. Upon Moulay Sharif's release in 1637 and when he was safely far from Sous, Sidi Mohammed led a rebellion which expelled Bou Hasen's followers from Sijilmasa. Subsequently, on April 23, 1640, he was proclaimed Emir of Tafilalt in place of his father, who relinquished the throne for him.
Later years and death.
Having relinquished the throne to his eldest son Sidi Mohammed, Moulay Sharif abandoned politics and concentrated his life in piety. Moulay Sharif spent time with his family; he was close to his youngest sons. At some point in Moulay Sharif's life, Arabs from Tafilalt offered him gifts when they came to greet him. Among those gifts were a Portuguese slave to serve him. The man, Dom Louis Gonsalez, was a Portuguese captive (a fidalgo and knight of the Order of Christ) who got lost during an adventure then brought unwillingly to Tafilalt despite explaining that his master was Ben Bakar the chieftain of "al-Gharb" province. Moulay Sharif, who was distraught at the sight of his gift, was going to have the slave brought back to his master. However, he changed his mind when his young children wanted to keep him because they had no Christian slaves. He kept Dom Louis to please his sons, and he bonded with Moulay Sharif's sons, particularly Moulay Ismail and Moulay Hicham .
Moulay Sharif died in Sijilmasa (near present-day Rissani), Tafilalt, on 4 June 1659. Upon his death, his eldest son Sidi Mohammed was re-affirmed sovereign. However, Sidi Mohammed's rivalry with his half-brother Moulay al-Rashid resulted in his evasion from Tafilalt in fear of Sidi Mohammed's retaliation. In 1664, Moulay Rachid, who auto-proclaimed himself Sultan, battled his eldest brother Sultan Sidi Mohammed in the Angad Plains where his brother perished. Moulay Rachid became the first Alaouite Sultan of Morocco and went on to conquer most of present-day Morocco.
Moulay Sharif's mausoleum is in the center of a mosque and religious complex in Rissani. The complex was rebuilt in 1955 following flood damage.
Personal life.
Moulay Sharif had 208 children, of which 84 were boys and 124 were girls. Among the children he had with his wives and slave concubines were:
With an unnamed wedded wife was born:
An Arab, the details known about this woman are that she was beautiful and that she was very dear to Moulay Sharif. Their son is:
Mubaraka bint Yark (pronounced Mbarka bint Yarg) was a mulatto slave of the Oulad Yahya ben Diman tribe, a tribe cited as being M'ghafra of Adrar, who was sold to the chiefs of the Oulad Jerrar tribe. The latter sold her to the head of the zaouïa of Illigh Bou Hassoun el-Semlali, and when Moulay Sharif was the later's captive he gave him Mubaraka as a slave concubine, and offered her to him upon his release in 1636. According to some sources Mubaraka and Moulay Sharif had a son Moulay Ismail during his captivity, which explains why some chronicles state that he was born in the Sous. But this causes is a large gap in his date of birth, making it unlikely. Since other chronicles explain that he was born the same year of the battle of al-Qa'a (Zawiya Dila'iya against Muhammad ibn Sharif) which happened in 1645. And according to Moulay Ismail's own words, the M'grafras are his maternal uncles, without further explanation on this degree of kinship, but it implies that in that case his mother is a free-born Muslim woman. Mubaraka is attributed as sons:
Moulay Ismail had a full brother:
Little information came to light about his other children, and no further details survive about his other wives. Among his other sons are: