They seized the country from the Qarmatians with the military assistance of Great Seljuq Empire in the year 1077–1078 CE.
In 1077–1078, an Arab sheikh named Abdullah bin Ali Al Uyuni defeated the Qarmatians in Bahrain and al-Hasa in the Siege of Hofuf with the help of the Seljuq Turks of Baghdad and founded the Uyunid dynasty.
Due to the influence of the Uyunid kingdom, Caliph al-Nasir li-Din Allah gave Muhammad b. Ahmad authority to protect the pilgrimage route to Mecca.
[1][failed verification] In the years 587 – 605 AH, Mohammed bin Abi al-Hussain united Qatif and Al-Hasa.
The state was divided again after his assassination in 605 H. The Uyunids were Muslim, however their sect is disputed; some sources mention they were Shia, others Sunni.