Ali al Hadi was born in Medina to Moroccan slave named Samana. He was only six when his father died, and when he had to take on the Imamate. Initially he lived in Medina in relative peace, where he mostly engaged in teaching. But upon the caliphate of Al-Mutawakkil, he was summoned to Baghdad and put under house arrest in Samarra, along with his son Hasan al-Askari. He was kept here to stop all communication between himself and his followers. His time in prison was a time of great persecution against the Shia.
He would live out his life under house arrest, and died at the age of 40 on July 1, 868. Like his predecessors, it may have been by poison. He was buried at his house in Samarra by his son, who was also the only person to attend his funeral. His burial spot is now an important Shia shrine.
Ali l-Hadi was born to a Moroccan slave called Samana, and, like his father, Muhammadu t-Taqi, he was only seven when he received the Imamate.
Brought to Samarra by Caliph al-Mutawakkil in 848, Ali l-Hadi was to spend the rest of his life under house arrest in the military district of the city.
Ali l-Hadi was his honorary title, meaning "the guided".