Several hadiths predicted the birth and occultation of Imam al-Mahdi (a), before his birth. Many hadiths also speak about his rule. According to these hadiths, he is the Imam who will rise by God's command and establish a universal rule. Before his uprising, he has two periods of occultation, one of which is longer than the other. The Minor Occultation started from the birth of the Imam until 329/940, when the last "special deputy" of the Imam (a) passed away. After that, the Major Occultation started, which will end when he will rise against the injustice and oppression that fills the world.

Minor Occultation
There are disagreements over when the Minor Occultation began. Some people believe that it began with the birth of Imam al-Zaman (a) in 255/869, and thus, it lasted for 74 years. But some others believe that it began since the martyrdom of Imam al-Hasan al-'Askari (a) in 260/874 in which case the Minor Occultation lasted for 69 years.During the Minor Occultation, Imam al-Mahdi (a) had interactions with the Shi'as through his Special Deputies and settled their issues, such as questions about beliefs, jurisprudential inquiries, and financial matters.

Major Occultation
Since the beginning of his imamate in 260/874, Imam al-Mahdi (a) had interactions with the Shi'as only through his Special Deputies.