Imam Musa ibn Ja'far Kazim, the son of the sixth Imam, was born in 128/744 and was poisoned and martyred in prison in 183/799. He became Imam after the death of his father, through Divine Command and the decree of his forefathers.
The seventh Imam was contemporary with the Abbasid caliphs, Mansur, Hadi, Mahdi and Harun. He lived in very difficult times, in hiding, until finally Harun went on the hajj and in Medina had the Imam arrested while praying in the Mosque of the Prophet.
He was chained and imprisoned, then taken from Medina to Basra and from Basra to Baghdad where for years he was transferred from one prison to another. Finally he died in Baghdad in the Sindi ibn Shahak prison through poisoning and was buried in the cemetery of the Quraysh which is now located in the city of Kazimayn.