Islam is the state religion in Bahrain. Due to an influx of immigrants and guest workers from non-Muslim countries, such as India, the Philippines and Sri Lanka, the overall percentage of Muslims in the country has declined since the late 20th century. Bahrain's 2010 census indicated that 70.2% of the population is Muslim. The last official census (1941) to include sectarian identification reported 52% (88,298 citizens) as Shia and 48 per cent as Sunni of the Muslim population. History Prior to Islam, the inhabitants of Qatar and Bahrain practiced Arabian paganism. Islam swept the entire Arabian region in the 7th century. Muhammad sent his first envoy Al-Ala'a Al-Hadrami to Munzir ibn Sawa Al Tamimi, the ruler of the historical region of Bahrain, which extended the coast from Kuwait to the south of Qatar including Al-Hasa, Qatif, and the Bahrain Islands, in the year 628 AD, inviting him to Islam. Munzir announced his conversion to Islam and all the Arab inhabitants of Bahrain and Qatar including some Persians living in Qatar also became Muslim, heralding the beginning of the Islamic era in Bahrain. The origins of Shia Islam in Bahrain can be traced back to 656-661 AD, the caliphate reign of Ali ibn Abi Talib. The prophet Muhammad appointed Aban Ibn Sa'id Al As () as governor of Bahrain during his lifetime. Aban was a major supporter of Ali's right to the caliphate, a position that was endorsed by the inhabitants of Bahrain including the influential Bani Abdul Qays tribe. The Khamis Mosque is believed to be the oldest mosque in Bahrain, with its origin dating back to the reign of Caliph Umar II. The Ismaili Shia sect known at the Qarmatians seized Bahrain in 899 AD, making it their stronghold and base of operations. They raided Baghdad and in 930 sacked Mecca and Medina, desecrating the Zamzam Well with the bodies of Hajj pilgrims and taking the Black Stone with them back to Bahrain where it remained for twenty years. The Qarmatians were eventually defeated by the Abbasids in 976 and afterwards their power waned. The defeat of the Qarmatian state saw the gradual wane of their revolutionary brand of Ismaili Islam. Instead, under a process encouraged by Sunni rulers over the next four hundred years, Twelver Shia Islam became entrenched. According to historian Juan Cole, Sunnis favoured the quietist Twelver branch of Shi'ism over the Qarmatians and promoted its