Muhammad ibn Ali ibn Abdallah or Muhammad "al-Imâm" was the son of "Ali ibn Abdallah ibn al-‘Abbas" and great-grandson of al-‘Abbas ibn ‘Abd al-Muttalib, the uncle of the Islamic prophet, Muhammad. He was born in Humaima in Palestine, and was the founder of the Abbasid dynasty in Arabia.
When al-Mukhtar announced the revenge of Imam al-Husayn, he showed himself as the representative of Muhammad ibn al-Hanafiyyah, the Promised Mehdi according to him.
After the death of Muhammad ibn al-Hanafiyyah, the imamate of Kaysanites Shia transferred to his son Abu Hashim, who transferred it to Muhammad, paving the way for the Abbasid dawa and the Abbasid Revolution.