The Imam was imprisoned by Haroun al-Rashid, the Abbasid caliph of the time, for many years and was finally ordered to be martyred by the same oppressive man.
Following is an excerpt from a speech by Leader of the Islamic Revolution Ayatollah Seyed Ali Khamenei delivered on April 12, 1985, according to the Leader’s office:
The threat Imam Musa Ibn Ja’far al-Kadhim (as) imposed on the caliphate system was that of a great leader with extensive knowledge; all those who were acquainted with him, knew him as a person with piety (taqwa), humbleness before God, and moral soundness; he had enthusiasts and friends around the world; he was so courageous that he feared no power against him. For the same reason, he spoke so fearlessly before the superficial grandeur of the Harounid monarchy.
Such a person--an activist, connected with God, who relied on God, having friends around the world, having a plan for setting up an Islamic government and system--was a great threat to the Harounid government. Thus, Haroun decided to get rid of this threatening presence. Of course, he was a keen politician; he didn’t decide on it hurriedly.
At first, he wanted to accomplish his plan in an indirect manner. Then, he came to the conclusion that imprisoning Imam Musa Ibn Ja’far (as) was the better solution: he could manage to make a deal with him in prison by offering him advantages or by pressuring him into subjugation and obedience.
He, then, ordered Imam Musa Ibn Ja’far’s arrest in Medina—without arousing the people of Medina or preventing them from learning about his location of imprisonment. Hence, they [Haroun’s men] prepared two horses: one to head towards Iraq and another towards the Levant; thus, to hide his whereabouts from the people.
They brought Imam Musa Ibn Ja’far (as) to the capital of the caliphate, Baghdad, and imprisoned him there. His confinement lasted for a long period of time! There is also a possibility—not with certainty—that Imam (as) was freed once and arrested again. What is certain is that the last time they arrested the Imam (as), they did it with the intention of killing him in prison; and they accomplished just that [murdering him].
However, the personality of Imam Musa Ibn Ja’far (as), in confinement was like that same guiding light which brightens all beings around it—truth reveals itself like this. The movement of Islamic thought and selfless endeavour (jihad), based on Quran, is such a movement; it never ends, even during the most challenging conditions.
In our own era, under the severe suppression applied by the [Pahlavi] regime, we witnessed individuals who were in exile or tortured in prison; they faced the most brutal conditions; and they never broke; instead, they broke their enemies. Not only were they not influenced [by the enemy], but, they influenced others: just as Imam Musa Ibn Ja’far (as) did.