It is indeed an old idea in Imamite history that one Imam from the progeny of the Prophet would go into hiding to prepare for the day when he would rise again under the title al-Qa’im al-Mahdi and fill the world with justice. The concealment (al-Ghayba) was considered a sign of the true al-Qa’im al-Mahdiand both before and after the occultation of the Twelfth Imam in 260/874. Many Shi’ite writers collected traditions attributed to the Prophet and the Imams concerning this issue. These traditions were used by many Shi’ite groups to back up the claims of their leaders who aspired to power by adopting the title of al-Qa’im al-Mahdi.
Before 260/874 they were used even by some Imamites themselves as evidence that one or another of their deceased Imams was in fact al-Qa’im al-Mahdi. Finally the same traditions have been used by the Imamites to support their claims that the Twelfth Imam was al-Qa’im al-Mahdi himself. These works on the subject of the Ghayba can be divided into three groups based on the dates of their authorship.