To further familiarize ourselves with Imam Mahdi, I would like to elaborate on the events prior to his birth. Governors of the time knew that the son of the 11th Imam (Imam Hassan Askari) would be the seal of the Imams, and the one who is destined to accomplish the divine task of spreading peace and justice to the world. Knowing this, they demanded to have Imam Hassan under house arrest in a military base, named Al-Askar, located in the city of Samera, in present-day Iraq; resulting in the word of Askari which was added to his glorious name. Female spies assigned by the government searched homes inside the military base, to investigate whether or not any women were pregnant, with the goal of finding the prospective son, to kill him before his birth. However, the non-believers were unaware that God Almighty has unlimited powers. Much like the way he placed Prophet Moses into the arms of the Pharaoh to be raised in his own palace, Imam Mahdi, who had a much greater responsibility than Moses, would be born regardless of any struggle of the enemies. Nargis Khatoun, mother to the final Imam, was pregnant, with no signs of being such.
Born on the 15th of Sha'ban in the year of 255 Hijri, Imam Mahdi (a.s.) would soon become the religious leader of the land following the death of the previous Imam, his father, which occurred in the year 260. Therefore, Imam Mahdi reached his position of Imamat at the age of five. Questions may rise regarding how a child of such an age could possibly become an Imam. The obvious answer to this question would date back to when the Prophet Jesus was born. As you may recall, the Prophet spoke once he was born, telling the people around him that God had already assigned him to the position of Prophet-hood. Therefore, for Imam Mahdi, who is to bear such a great responsibility, greater than all preceding Prophets and Imams, any age which God specifies is appropriate for his Imamat, since this position is a divine status which is independent of age, and there is precedence to this, among Prophets and Imams.