Abdallah bin Ahmad was one of the twenty sons of Imam Al-Mutawakkil Ahmad. After his father's death in 1816, he successfully claimed the Imamate under the name of Al-Mahdi Abdallah. A British surgeon visited him in 1823 and described him as a tall, slender man of dark complexion. He was reputed to have an excitable nature and often changed his ministers. His government was portrayed as weak; as the imam had to pay large stipends to various tribes in order to prevent them from plundering the land. Local Sheikhs grew more assertive over time and demanded ever-higher subsidies. This became apparent when a crisis broke out in 1818 after al-Mahdi mistreated emisaries from the Bakil tribe. As a consequence, the northern tribes entered San'a and plundered for 22 days. Only when Al-Mahdi promised to pay 120,000 Riyals did they withdraw.
The politico-religious Wahhabi movement had intervened in Yemen since 1803, and the area controlled by the imam had shrunk critically. Parts of the lowlands, Tihamah, stood under the chief of Abu Arish, Sharif Hamud, who took an independent position and sometimes supported the Wahhabi ruler. When Hamud died in 1818, he was succeeded by his son Ahmad. Ahmad allied with the Saudi family, leaders of the Wahhabi movement in order to fight Ottoman troops in Najd. However, the Ottoman forces were victorious and proceeded to invade Abu Arish. Ahmad was captured, and all his possessions in Yemen were returned to al-Mahdi Abdallah. In spite of mutual distrust, an agreement between the imam and the Ottomans was reached, whereby the imam sent coffee to the sultan's court. After 15 years, Tihamah was therefore once again in the hands of the Zaidi State.
The British of Bombay traded in the important Yemeni seaport of Mocha. In 1817, a British lieutenant was mistreated by the local population, and the British Indian authorities demanded action be taken. The imam's governor in Mocha declined the demand, and military action followed in 1820. After an initial setback, the British troops breached the walls of Mocha and forced an agreement. The following year, al-Mahdi Abdallah sent a firman to the British trading office in Mocha where he agreed to reduce import duties. During the 1820s the British grew increasingly sceptical about their prospects in Mocha. They started to look for an alternative port and found Aden to be an attractive alternative. Aden at this time was under the Sultanate of Lahej, outside of al-Mahdi Abdallah's territory. This eventually led to the British capture of Aden in 1839.
Al-Mahdi Abdullah executed the famous Sheikh Ali bin Abdullah Alshaif. This execution caused the brother of the deceased, Hussien bin Abdullah Alshaif, to rally the tribes of northern Yemen: Hashid, Bakil and Mudhaj in an invasion of San'a, capturing al-Mahdi Abdullah in the process. They used ladders given to them by the Sharif of Beihan to climb the walls. When captured by Hussien, the Imam ordered that Hussien's father, Abdullah, be released from prison in fear for his own life. When Abdullah entered the palace and saw his son Hussien about to kill the imam, his father yelled "Have mercy on your İmam, Hussien". Hussien said to his father "But he killed my brother!" His father took his jambia off and cut off his beard (a sign of begging in the northern tribal parts of Yemen). His son dropped his sword, sparing the Imam. The imam said "Ask for anything, Hussien." Hussein said, "I want to be the Governor of Ibb." (Yemen today) Hussein also asked to be Governor of Hajjah and Dhale, where many tribes came from.
Bakil settled in Ibb. Hussien's son Abdul Wahab and his brother's sons ruled over Ibb until the late 1800s when they were expelled by the Ottomans. The Alshaif dominance in these areas continues. The Imams used the Alshaif family as a defense from the people of Yemen from that time forward. They believed that the family would work against them if they did not work for them. In 1908 Shaykh Naji bin Abdulwahab bin Hussien Alshaif led the war against the Ottomans, taking San'a, and placing Imam Yahya back in power.
The authority of Al-Mahdi Abdallah in parts of Yemen was eroded by the appearance of a Circassian adventurer, Türkçe Bilmez. He was a soldier serving under the Egyptian viceroy Muhammad Ali Pasha in Hijaz, where he mutinied and gathered discontented Ottoman units. The mutineers marched into the Tihamah in 1832, capturing Mocha and Hudaydah, and the land in between. He concluded an alliance with a chief of Asir, Ali bin Mukhtar, whereby they were to support each other and share the revenues of the occupied territory. Al-Mahdi Abdallah had few resources to counter the intruders.
With a British endorsement, Muhammad Ali sent an Egyptian force to Yemen in 1833 to deal with the chaotic situation, which was highly detrimental to trade. The Asiris fell out with Bilmez and besieged his forces in Mocha, which was blocked from the sea by the Egyptian fleet. Finally, the city fell and was plundered by the Asiri tribesmen, while Bilmez was saved on a British ship. After these events, fighting broke out between the Egyptians and the Asiris on Yemeni soil. The conflict continued for years, until in 1837 Egyptian reinforcements secured the coastal cities and some of the interior. Al-Mahdi Abdallah, unable to contain the turmoil, considered giving up his country, or what remained of it, to Muhammad Ali, but this was plainly rejected by his subjects. When he died in 1835, the Zaidi state was only a shadow of its former condition. Al-Mahdi Abdallah was succeeded by his son al-Mansur Ali II.