Shiites hold that after the Prophet Muhammad died, religious and temporal authority in Islam should have passed to his son-in-law, Ali, and then to Ali's sons with Fatimah, the daughter of the Prophet-- Hasan and then Husayn. Husayn was martyred in 680 and succeeded by his son, Ali Zayn al-Din. His successor was his eldest son, Muhammad Baqir. The latter was succeeded by Ja`far al-Sadiq, who was the founder of the Twelver Shiite legal tradition. He had two sons, Isma`il and Musa al-Kazim. Initially Isma`il was set to succeed him, but for some reason (the early sources differ on why), he set Isma`il aside in favor of his younger brother, Musa al-Kazim. There was a major schism in Shiite Islam over this succession issue, with some believers insisting on sticking with Isma`il and his descendants, becoming the Ismailis. The Twelver Shiites, who predominate in Iraq and Iran, followed Musa al-Kazim, and they even now maintain that Isma`il died at a young age and so was never appointed Imam in the first place. Musa Kazim is said to have been imprisoned for 4 years by the Abbasid Caliph Harun al-Rashid, and Shiite folk tradition maintains that the caliph did in the imam. The Abbasid caliphs were rivals for power with the Shiite Imams.
Informed Comment, Juan Cole