Muhammad ibn Ali al-Hadi

Abū Jaʿfar Muḥammad ibn ʿAlī al-Hādī (أبو جعفر محمد بن علي الهادي) was a descendant of the Islamic prophet Muhammad and the son of Ali al-Hadi and the brother of Hasan al-Askari, the tenth and eleventh Imams in Twelver Shia, respectively. Some may have expected him to succeed his father al-Hadi to the imamate but he predeceased him in the garrison town of Samarra in Iraq, where al-Hadi was kept under surveillance by the Abbasids. His shrine is located near Baghdad, between Samarra and Kadhimiya. Considered a sacred site in Twelver Shia, his shrine was targeted by Sunni militants in 2016 in a deadly attack on its pilgrims.

Death
Muhammad ibn Ali al-Hadi died in the garrison town of Samarra, then the capital of the Abbasids. Some expected him to be the next Imam but he predeceased his father Ali al-Hadi, who was kept in Samarra under close surveillance by the Abbasids until his death in 868 CE. After al-Hadi, the majority of his followers acknowledged as their next Imam his adult son Hasan, brother of Muhammad. Hasan is commonly known by the title al-Askari (lit. 'military') on account of his almost life-long detention in Samarra. After al-Hadi, some followers of the Shia figure Faris ibn Hatim ibn Mahawayh al-Qazvini claimed that Muhammad was the next Imam, even though he had died before his father. This was apparently an act of defiance to al-Askari, who had sided with his father al-Hadi when he excommunicated his erstwhile representative Faris for embezzling religious dues and openly inciting against him. When al-Askari mysteriously died without an obvious heir in 874 CE, some rejected his imamate because they argued that the Imam could not be childless. Among them, Muhammadites believed that his brother Muhammad must have been the rightful eleventh Imam, even though he had predeceased his father al-Hadi. Thus they turned to the offspring of Muhammad, or considered him to be the Mahdi, the messianic figure in Islam to (re)appear at the end of times to eradicate injustice and evil. Probably related to this group was Ibn Nusayr, who regarded al-Hadi as divine and claimed to be his prophet. He is considered the founder of the Nusayris, a Ghali sect of Shia. The Ghulat (lit. 'exaggerators') believed in the divinity of the Shia Imams. Nafisites were another group who believed that al-Hadi had appointed his son Muhammad as his successor. Before he died in the lifetime of his father, they said, Muhammad designated his brother Ja'far as his successor. More specifically, they believed that Muhammad entrusted his testament to his servant Nafis, who passed it on to his brother Ja'far. The latter thus claimed he was the successor to Muhammad. Nafis himself was killed. These and similar sects, however, soon disappeared except the group that went on to form the Twelver Shia. They believe in the imamate of the messianic Muhammad al-Mahdi, a son of al-Askari whose birth is said to have been concealed from the public.

Attack on his shrine
On 7 July 2016, at least 40 people were killed and over 74 injured after a group of attackers stormed the shrine of Muhammad ibn Ali al-Hadi. The attackers included suicide car bombers, suicide bombers on foot, and several gunmen. They attacked Shia pilgrims celebrating Eid al-Fitr, which marks the end of the Muslim holy month of Ramadan. The Sunni militant group ISIL is held responsible for the attack. Prior to this attack, there had been bombing and sectarian bloodshed in the al-Askari shrine in Samarra, which houses the tombs of Ali al-Hadi and Hassan al-Askari, the father and brother of Muhammad.