Ja'far ibn Muhammad al-Hasani

Ja'far ibn Muhammad ibn Husayn al-Hasani was Sharif of Mecca from the late 960s to the early 970s, and the first emir belonging to the Musawid dynasty.

He was a Hasanid, descendant of the ninth generation from Hasan ibn Ali. His sister was married to Akhu Muslim, a distinguished Alid sharif who rose in unsuccessful revolt against the Fatimid conquest of Egypt.

According to Ibn Khaldun, Ja'far came from Medina and conquered Mecca. He ordered the Friday sermon to be read in the name of the Fatimid caliph al-Mu'izz after the latter conquered Egypt in 969. Although the date Ja'far conquered Mecca is not known, Ibn Hazm writes that it was during the reign of the Ikhshidids in Egypt. Al-Fasi narrows it down to the years 356–358 AH (967–969), since Ikhshidid influence in the Hejaz waned after the death of Abu al-Misk Kafur. However, he does acknowledge that this is contradicted by some chronicles which indicate that Ja'far had Kafur's name pronounced in the Friday sermon.

The sources provide different dates for the year in which Ja'far captured Mecca: the years 967, 968, 969, and the entire period 951–961 are mentioned. It is likewise uncertain that he was from the outset a Fatimid partisan: it is recorded that the Friday sermon was read in al-Mu'izz's name already in 969, but due to the Qarmatian presence in much of Arabia, it took until the defeat of the Second Qarmatian invasion of Egypt and peace between Fatimids and Qarmatians until Fatimid suzerainty over the Hejaz was established in 975. The death of al-Mu'izz later in that year was used as a pretext—very likely with Qarmatian encouragement—by Ja'far for the renunciation of Fatimid suzerainty, but the dispatch of an army that cut off the city's grain supply swiftly restored Fatimid control.

Ja'far founded a long line of Hasanid Sharifs of Mecca, which lasted until their overthrow by the Saudis in 1924. Ja'afar's line, the Ja'farid dynasty, ended with Shukr ibn Abi'l-Futuh in 1061. Medina was frequently controlled by the Husaynids.