After the fall of the Safavid dynasty, Bahrain went through a period of anarchy, dismay, and self-rule in villages which made the country vulnerable to foreign invasions. Utub forces often attacked the island during this phase which made the spiritual leader of Bahrain, Sheikh Mohammed ibn Abdullah Al Majed, use the Huwala to combat the Utubs' attacks. These attacks continued throughout the early 18th century until the Utubs launched a full-scale invasion of the island and established a government loyal to the Sultan of Muscat. The Utubs were defeated and expelled by the Huwala forces loyal to Bahrain's spiritual leader who established a government headed by Sheikh Jabara Al-Holi (also known as Jubayr al-Holi). The Persian Afsharids led by former Safavid general Nader Shah invaded the island in 1737 and deposed Sheikh Jabara. Persian rule continued for 46 more years, with brief interruptions, until the Utubs finally took over the island in 1783.