Oman’s inhabitants adopted Islam during the life of the Prophet Muhammad in circa 630 CE. Earlier, Omanis had worshipped gods related to the sun, the moon, and other celestial bodies. Believers in Hinduism and Christianity were also present in the region. Omanis became involved in the foundation of the Ibadiya sect in Basra in the mid-7th century. The doctrine spread in Oman (it was also adopted in North African countries such as Algeria and Tunisia, where pockets still exist today) and followers subsequently built a state under the leadership of their own elected religious head, the Imam. The first Ibadi Imamate came into being in 750 CE under Imam al-Julanda ibn Masud. As a result Oman gained independence from the Abbassid Caliphate in Baghdad.
The Imamate, the first central power in Oman, was successful in unifying the semi-independent tribes. It strengthened the naval force and profited from the extensive trade network, which connected the Islamic world with Europe and the Far East. In the 9th century, the first Omani ship sailed to China. Sohar became the main port in the Persian Gulf, the busiest in the region for the following two centuries. As Oman was united and had control over its ports, it could expand its trade network and profit from the wealth generated.
In 1784, Said bin Ahmad, a member of the Al Bu Said, discarded the title of Imam. From this moment, the central authority was headed by secular rulers, which has lasted until the present day. These rulers called themselves sayyids (claiming to be descendants of the Prophet Muhammad). The title of Sultan was first used by the British in the 19th century, but was only hesitantly accepted by the tribal leaders.