Islam was first brought to Morocco in 680 by an Arab invasion under Uqba ibn Nafi, who was a general serving under the Umayyads of Damascus. In 788, The Zaydi Shia Idrisids ruled large parts of Morocco. Their contemporaries included the heretical Barghawata state and the Khariji state of Sijilmasa. Later, several Berbers formed more powerful Islamic dynasties that reigned over the country. Among them were the Almoravids, who were the first to unite Morocco, as well as significant regions in West Africa, Spain and Algeria. These Almoravids were responsible for making the Maliki school the most prominent in Morocco. It was under Almohad rule that Muslim sects were prosecuted and orthodox Sunni Islam became prevalent across the country. In 2008, Iran-Morocco ties were almost destroyed when Moroccan government accused the Iranian embassy in Morocco of promoting Shia Islam. Moroccan Sunnis have in the past accused Shias of proselytizing with Shia sermons to its citizens.