Muhammad ibn Qasim was an Alawite Imam. He led an Alawite rebellion that took place in Taloqan at the beginning of the 3rd century of Hijrah (A.H.), in the year 219 A.H (834 C.E.) and during the days of the Caliphate of Al-Mu'tasim. However, Al-Mu'tasim defeated and arrested him and carried him to Baghdad, detaining him in his palace. Shortly after, Muhammad was able to run away and flee, and was never heard of again.
Due to the unknown nature of his disappearance, people differed about his affair. Some people believed he died or fled, while some of the Shiites believed he was alive and would reappear and that he was the Mahdi.