Imam Hasan al-`Askari spent twenty-two years of his life under the patronage of his father , Imam `Ali al-Hadi (an-Naqi) after whose martyrdom he became his divinely commissioned Imam.
During the seven years of his Imamate , due to untold restrictions placed upon him by the caliphate , he lived in hiding and dissimulation (taqiyyah). He did not have any social contact with even the common people among the Shi’ites population. Only the elite of the Shia were able to see him. Even so , he spent most of his time in prison.
There was extreme repression at that time because the Shi’ites population had reached a considerable level in both numbers and power. Everyone know that the Shia believed in the Imamate , and the identity of the Shi’ites Imams was also known. Therefore , the caliphate kept the Imams under its close supervision more than ever before.
It tried through every possible means and through secret plans to remove and destroy them. Also , the caliphate had come to know that the elite among the Shia believed that the Eleventh Imam , according to traditions cited by him as well as his , forefathers , would have a son who was the promised Mahdi. The coming of the Mahdi had been foretold in authenticated hadith of the Prophet in both Sunni and Shi’ites sources.
For this reason the Eleventh Imam , more than other Imams , was kept under close watch by the caliphate. The caliph of the time had decided definitely to put an end to the Imamate in Shi`ism through every possible means and to close the door to the Imamate once and for all.
Therefore , as soon as the news of the illness of the Eleventh Imam reached al-Mu`tamid , he sent a physician and a few of his trusted agents and judges to the house of the Imam to be with him and observe his condition and the situation within his house at all times. After the death of the Imam , they had the house investigated and all his female slaves examined by the midwife.
For two years the secret agents of the caliph searched for the successor of the Imam until they lost all hope. The Eleventh Imam was buried in his house in Samarra’ next to his noble father.