Abu Abd Allah al-Sheikh Muhammad ibn Yahya

Abu Abd Allah al-Sheikh Muhammad ibn Yahya (أبو زكرياء محمد الشيخ المهدي) (also known as Abu Abdellah al-Shaykh Muhammad ben Yehya, Abu Abdallah Sheikh Muhammad ibn Yahya or Muhammad ibn Yahya al-Sheikh) was the first Wattasid Sultan of Morocco and King of Fez between 1472 and 1504.

Background
Abu Abd Allah al-Sheikh Muhammad ibn Yahya was born into the powerful Wattasid family that had ruled the eastern Rif from Tazouta (near present-day Nador) since the late 13th century. While theoretically subject to the Marinid sultans, they were largely autonomous. By the start of the 15th Century, the Wattasids had accumulated power while the Merinids were distracted attempting to repel Portuguese and Spanish invasions with the Granadans. When Abd al-Haqq II came to power at the age of one in 1421, they held the regency, which they continued to hold when Abd al-Haqq II came of age. In 1459, Abd al-Haqq II ordered the slaughter of the Wattasids, leaving Abu Abd Allah al-Sheikh Muhammad ibn Yahya one of the few of his family left alive.

Rise to Power
In the chaos that followed the 1465 Moroccan revolt, Abu Abd Allah al-Sheikh Muhammad ibn Yahya fought against the Joutey branch of the Idrisids. In 1471, he defeated their leader, Muhammad ibn Ali Amrani-Joutey, who had declared himself Sultan. He went on to rule the Kingdom of Fez which controlled the northern part of Morocco.

Absorption of Jewish deportees from Spain
Muhammad a-Sheikh welcomed the deportees from Spain with open arms. The documentarian who was one of the deportees from Spain, Rabbi Abraham ben Solomon, therefore calls Muhammad the title of Righteous Among the Nations.

Succession
He was succeeded by his son Abu Abd Allah al-Burtuqali Muhammad ibn Muhammad.