His father was Imam Ali al-Hadi (a.s.), the tenth imam of the Shi’a faith. He was from the masters of the Ahlul Bayt (a.s) and the most knowledgeable, pious, and virtuous of all people at his time.
Imam Abu Muhammad al-Askari (a.s.) spent a part of his life with his father Imam al-Hadi (a.s.). He did not part with him even in his travels. He saw in his father a true picture of the morals of his grandfather the messenger of Allah (s.a.w.w.) who had been preferred to all prophets, and saw in him the spirits of his fathers, the infallible imams (a.s.).
On the other hand, Imam al-Hadi (a.s.) saw in his son the natural continuity of the great Imamate and general authority of the Prophet (s.a.w.w.), and therefore he cared much for him. He praised him saying, “My son Abu Muhammad is the best of the progeny of Muhammad (blessing be on him and on his progeny) in nature, and the most trustworthy in authority. He is the eldest of my children, and he is my successor and the recipient of the handholds of Imamate and its governance.”
of course, Imam al-Hadi (a.s.) was far above flattering or submission to emotions. He did not praise his son and announce his virtue unless he saw in him all noble aspects and high qualities. And it was so, because Imam Abu Muhammad al-Askari (a.s.) had all these virtues and nobilities.
Imam al-Hasan al-Askari (a.s.) kept to his father Imam al-Hadi (a.s.) and saw what he suffered from the Abbasid kings, especially al-Mutawakkil who spared no effort in oppressing Imam al-Hadi (a.s.). This tyrant was excessive in harming the Imam. He house-arrested him in Samarra’ and surrounded his house with policemen and detectives to watch him, and to prevent the ‘Ulama’, jurisprudents, and the rest of the Shi’a from associating with him. Al-Mutawakkil also oppressed Imam al Hadi (a.s.) in his living affairs, and ordered his men to search the house of the imam from time to time and take him to al-Mutawakkil in whatever state he was. It was al-Mutawakkil himself who had prevented officially the visiting to the holy shrine of Imam al-Husayn (a.s.), and ordered the shrine to be destroyed. All those terrible events took place before the eyes of Imam Abu Muhammad (a.s.) while he was yet in the early years of his youth. His heart was filled with pains and sorrows during the period he lived with his father.