The Ottoman Turks returned to the Tihamah in 1849 and al-Mutawakkil Muhammad was summoned to submit. The imam accompanied a Turkish army to San'a. However, the day after the arrival of the detachment to the city, it was furiously attacked by the locals, supposedly enjoined by the imam. The Turkish commander Tefvik Pasha, who was badly wounded, immediately deposed al-Mutawakkil Muhammad and raised al-Mansur Ali to the imamate for the third time. Soon after, the Turks retreated to Hudaydah in the Tihamah. With the Turks gone, the power struggles continued in the rump Zaidi state. Al-Mansur Ali threw al-Mutawakkil Muhammad in prison and had him beheaded in December 1849. In June 1850 he was deposed for the third time by a rising headed by a distant relative called al-Mu'ayyad Abbas.
