Second Ibadhi Imamate
I'm so glad you asked.
In December 793, an Ibadhi rebellion led by the Yahmad tribe of the Azd deposed the Abbasid agent Rashid b. an-Nazr, entered his capital at Nizwa, and proclaimed a new Ibadhi state. Thereafter the leading Ibadhi religious scholars met in the nearby town of Manh to determine who should be Imam. The meeting was tumultuous, as many of those attending felt themselves best qualified for the position. Amidst the controversy, Musa b. Abi Jabir, the most influential figure present, appointed a Basran named Muhammad b. Abi Affan al-Yahmadi as governor of Nizwa. Shortly thereafter, Muhammad was named Imam, perhaps because as an outsider he was untainted by Oman's tribal feuds.
Muhammad's imamate, however, proved short-lived. He immediately faced opposition from the Julandas, the clan which had ruled Oman in late Sassanid times and at intervals ever since. They led a revolt in the east, which Muhammad's forces crushed using brutal force, even burning one rebel tribe's date palms. This aroused much outcry because in Islam, destroying produce-producing trees is a crime in war, as it ruins the economy of the area until the trees grow back. Muhammad's personal style also offended influential Omanis, as he failed to consult them as was custom for rulers in the area.
After two years, Muhammad b. Abi Affan was deposed and went back to Basra. His successor was a man named al-Warith b. Ka'b al-Kharusi. He settled many of the tribal feuds in the country, and was renowned for his wisdom and moderation. In fact, some of his followers found him too much so. During his time, the Abbasids attempted to reconquer Oman, but were defeated at the Battle of Hetta. After consultation, Imam al-Warith ordered the Abbasid general sentenced to life in prison. Many Omanis felt this was too lenient, went to the prison, and killed the general. Nonetheless, al-Warith b. Ka'b led Oman until 807, when a flood threatened to engulf a prison near Nizwa. The Imam ordered the prisoners released, and when no one would go let them out, went himself. During the course of this rescue mission, he drowned.
After al-Warith's death, there was no obvious successor, so a number of religious scholars suggested writing to all the people of Oman to seek their input. Others, however, felt that might be impractical and give rise to feuds, and so they turned to Ghassan b. Abdullah al-Yahmadi as the new imam. He immediately faced a revolt connected to the Julandas, which was defeated, and Ghassan had as-Saqr b. Muhammad al-Julanda assassinated. At the same time, there was another tribal revolt, though its leader sought sanctuary from some shaykhs of Yahmad, and the imam honored the promise of his fellow tribesmen.
At one point during his imamate, Ghassan temporarily moved his capital to Suhar, the port which during the 9th century was one of the largest cities in the Persian Gulf region. There he began building a navy to defend the coasts against the pirates who were become a significant menace to Oman's people as well as its commerce. In addition, he worked to improve Oman's irrigation channels and ordered that owners of agricultural slaves could force them to work during the day or night but not both, as was becoming common.
In 822, Imam Ghassan died. He was succeeded by the elderly Abd al-Malik b. Humayd al-Alawi. Despite his age, he reigned for 17 years, during which he relied heavily on a council of religious scholars to run the state. Chief among these was a man named Musa b. Ali, who became Acting Imam for a brief time after Abd al-Malik's death in 840. He was instrumental in ensuring the succession of al-Muhanna b. Jayfar al-Yahmadi, who was known for his strictness. He expanded the Imamate's navy and began keeping at standing army of 10,000 in Nizwa, with additional detachments in other parts of the country. His reign saw the last revolt of the Julandas, who were crushed completely and dispersed. When the controversy over the createdness of the Qur'an came to Oman, the religious scholars agreed upon a compromise formula which Imam al-Muhanna imposed forcibly during his imamate.
As al-Muhanna grew old, many felt he should abdicate, and a group of religious scholars raised the issue with Musa b. Ali. Musa took the suggestion to the imam, who replied that if he were to step down at the people's request, no imam would ever last for a year again. He died in 851, to be succeeded by as-Salt b. Malik al-Kharusi, whose reign of 34 years was the longest of any Ibadhi imam in medieval Oman. The power of the Imamate had grown to the point where near the end of Imam as-Salt's reign, he actually launched a military expedition to the island of Socotra in the Arabian Sea. The details are unclear, but there was a Muslim presence there which was facing a Christian uprising supported by Ethiopia. The expedition of 100 ships carried with it a book on the Islamic rules of warfare, and sailed with two key missions. The first was to drive the Ethiopians as far away as possible, even if it meant attacking the coast of Africa itself. The second, because the imam felt continued violence was likely, was to evacuate any Muslims who wished and provide them passage to the lands of Islam. Regrettably, we don't know how it all turned out.
Imam as-Salt's reign, however, also saw a great disaster, as terrible flooding claimed many lives and destroyed trees, crops, and livestock. The blow was terrible, leading whole villages to migrate elsewhere. It is this which I suspect led to surge of tribal warfare which followed and would swiftly bring down the Second Ibadhi Imamate.
Imam as-Salt himself became a casualty of the conflict when a group led by one Musa b. Musa sought to depose him from the imamate, which they succeeded in doing, though all the sources are so partisan we can say little for sure about the actual events. After this, Musa appointed a friend of his named Rashid b. an-Nazr as imam, with himself as chief advisor. Most of the religious scholars felt this was inappropriate and a massive alliance was formed to depose Rashid. They were defeated, but the imam was still isolated and friendless. Musa then joined the opposition and attempted to take charge of it. Rashid was defeated and imprisoned in 890.
Musa b. Musa then tried to appoint another friend of his named 'Azzan b. Tamim al-Kharusi as imam with himself as chief advisor, but many of the religious scholars were coming to have doubts about Musa, and sought another candidate. They went to Rashid, who agreed to repent of his alleged evil, and set him up once again as imam, but quickly thought better of it and redeposed him. In 891, a huge battle took place at al-Qa' in which 'Azzan's forces crushed an opposition army consisting mainly of Nizaris. Tribal loyalty was now clearly trumping religion, as the Nizaris appealed for help to the Abbasid caliph al-Mu'tadid in Baghdad. He sent a huge army under Muhammad b. Nur which conquered the country in 893 and laid much of it to waste. Although the Abbasids did not long remain, the Second Ibadhi Imamate had come to an end, and Oman fell into what would be centuries of turmoil.
(Source: Al-Rawas, Isam, Oman in Early Islamic History, (Reading: Ithaca Press, 2000)).