Ali ibn Muhammad al-Hadi (Arabic: عَلي إبن مُحَمَّد الهادي النَّقي; c. 7 March 828 – c. 21 June 868) was a descendant of the Islamic prophet Muhammad and the tenth Imam in Twelver Shia, succeeding his father, Muhammad al-Jawad (d. 835). Born in Medina in 828, Ali is known with the titles al-Hādī (Arabic: الهادي, lit. 'the guide') and al-Naqī (Arabic: النقي, lit. 'the distinguished'). After the death of his father in 835, most followers of al-Jawad readily accepted the imamate of Ali, who was still a child at the time. Drawing parallels with the story of young Jesus in the Quran, Twelver sources attribute an exceptional innate knowledge to Ali which qualified him for the imamate despite his young age.
As with most of his predecessors, Ali al-Hadi kept aloof from politics until he was summoned around 848 from Medina to the capital Samarra by the Abbasid caliph al-Mutawakkil (r. 847–861), known for his hostility towards Shias. There al-Hadi was held under close surveillance until his death in 868 during the caliphate of the Abbasid al-Mu'tazz (r. 866–869). Still, he managed to communicate with an underground network of representatives who organized the financial and religious affairs of the Shia community on his behalf. Most Shia sources hold the Abbasids responsible for his death at the age of about forty through poison, with the notable exception of al-Shaykh al-Mufid (d. 1022). His image in Twelver sources is that of a pacifist, persecuted Imam who endured numerous attempts by members of the Abbasid court to humiliate and dishonor him. These sources also allege more serious incidents of house search, temporary imprisonment, and even murder plots against al-Hadi.