The Twelver imam line ended with a concealed Mahdi in 873
Evidence
After many early disagreements about the imamate, most of the Shi a agreed on a sequence of twelve imams. These consist of Ali, his sons Hasan and Husayn, and the latter’s descendants down to the twelfth imam, known as Muhammad al-Mahdi, who disappeared in about the year ad 873. Some branches of the Shi a have recognized other imams, notably some of the Isma ilis, whose line of imams has continued to the present day. But the great majority of the Shi a are known as Twelvers, because of their acceptance of the twelve imams. They believe that the twelfth imam went into concealment and it is he who will return, as mahdı¯, at the end of time. — Bernard Lewis, From Babel to Dragomans, 1447