His martyrdom

Al-Mu’tamid, the Abbasid tyrant, could not bear Imam Abu Muhammad (AS) any longer, for he saw and heard people everywhen and everywhere glorify the Imam and prefer him over all the Alawids and the Abbasids. So, he decided to kill the Imam.
He assassinated him (pbuh) by giving him fatal poison in his food.The Imam (pbuh) ate it, thus it poisoned his holy body. He (pbuh) suffered bitter and severe pain, yet being patient and resorting to Allah. 

After 8 days, the Imam (pbuh) martyred. His holy and pure body was carried amongst the cries of "Allah is Great" to his grave. He (pbuh) was burried in his house besides his honorable father’s grave in Sameraa City.The funeral prayers (Salat) were led by the Awaited Imam Al-Mahdi (May Allah hasten his Advent).

[1] Al-Irshad, p.383.