Imam Ali ibn Muhammad Naqi (sometimes referred to by the title of Hadi), was the son of the ninth Imam. He was born in 212/ 827 in Medina and according to Shi'ite accounts was martyred through poisoning by Mu'tazz the Abbasid caliph, in 254/868.
The tenth Imam was a contemporary of seven of the Abbasid caliphs: Ma'mun, Mu'tasim, Wathiq, Mutawakkil, Muntasir, Musta'm and Mu'tazz. It was during the rule of Mu'tasim in 220/835 that his noble father died through poisoning in Baghdad. At that time Ali ibn Muhammad Naqi was in Medina. There he became the Imam through Divine Command and the decree of the Imams before him. He stayed in Medina teaching religious sciences until the time of Mutawakkil. In 243/857, as a result of certain false charges, Mutawakkil ordered one of his government officials to invite the Imam from Medina to Samarrah which was then the capital. He himself wrote the Imam a letter full of kindness and courtesy asking him to come to the capital where they could meet.
Upon arrival in Samarrah the Imam was also shown certain outward courtesy and respect. Yet at the same time Mutawakkil tried by all possible means to trouble and dishonour him. Many times he called the Imam to his presence with the aim of killing or disgracing him and had his house searched.
In his enmity toward the Household of the Prophet (pbuh) Mutawakkil had no equal among the Abbasid caliphs. He was especially opposed to Ali, whom he cursed openly. He even ordered a clown to ridicule Ali at voluptuous banquets. In the year 237/850 he ordered the mausoleum of Imam Husayn in Kerbala and many of the houses around it to be torn down to the ground. Then water was turned upon the tomb of the Imam. He ordered the ground of the tomb to be ploughed and cultivated so that any trace of the tomb would be forgotten.
During the life of Mutawakkil the condition of life of the descendants of Ali in the Hijaz had reached such a pitiful state that their womenfolk had no veils with which to cover themselves. Many of them had only one old veil which they wore at the time of the daily prayers. Pressures of a similar kind were put on the descendants of Ali who lived in Egypt. The tenth Imam accepted in patience the tortures and afflictions of the Abbasid caliph Mutawakkil until the caliph died and was followed by Muntasir, Musta'in and finally Mu'tazz, whose intrigue led to the Imam being poisoned and martyred.