responded to his mission and converted the entire area.
In 899 AD, the Qarmatians, a millenarian Ismaili Muslim sect seized Bahrain, seeking to create a utopian society based on reason and redistribution of property among initiates. Thereafter, the Qarmatians demanded tribute from the caliph in Baghdad, and in 930 AD sacked Mecca and Medina, bringing the sacred Black Stone back to their base in Ahsa, in medieval Bahrain, for ransom. According to historian Al-Juwayni, the stone was returned 22 years later in 951 under mysterious circumstances. Wrapped in a sack, it was thrown into the Great Mosque of Kufa in Iraq, accompanied by a note saying "By command we took it, and by command we have brought it back." The theft and removal of the Black Stone caused it to break into seven pieces.
Following a 976 AD defeat by the Abbasids, the Quarmations were overthrown by the Arab Uyunid dynasty of al-Hasa, who took over the entire Bahrain region in 1076. The Uyunids controlled Bahrain until 1235, when the archipelago was briefly occupied by the Iranian ruler of Fars. In 1253, the Bedouin Usfurids brought down the Uyunid dynasty, thereby gaining control over eastern Arabia, including the islands of Bahrain. In 1330, the archipelago became a tributary state of the rulers of Hormuz, though locally the islands were controlled by the Shi'ite Jarwanid dynasty of Qatif.
Until the late Middle Ages, "Bahrain" referred to the larger historical region of Bahrain that included Al-Ahsa, Al-Qatif (both now within the Eastern Province of Saudi Arabia) and the Awal Islands (now the Bahrain Islands). The region stretched from Basra in Iraq to the Strait of Hormuz in Oman. This was Iqlīm al-Bahrayn's "Bahrayn Province". The exact date at which the term "Bahrain" began to refer solely to the Awal archipelago is unknown. In the mid-15th century, the archipelago came under the rule of the Jabrids, a Bedouin dynasty also based in Al-Ahsa that ruled most of eastern Arabia