The Qarmatians retreated to their home territory in Bahrayn, and despite al-A'sam's urgings, reached an accommodation with the Fatimids and largely withdrew from interference in the affairs of the Levant thereafter.
Led by al-Hasan al-A'sam, these raids brought the Qarmatians enormous booty, as well as the promise of an annual tribute of 300,000 gold dinars from the Ikhshidid governor.
[4][5][11] Medieval historians, as well as some of the first modern scholars to examine Isma'ili history, saw a collusion between the Fatimid enterprise in the west and the Qarmatian attacks in the east, but more recent scholarship has disproven this.
[15][16] As a result, the Qarmatians made common cause with the other regional powers against the Fatimids: Through the mediation of the Abbasid caliph al-Muti', the Qarmatians became the nucleus of a broad anti-Fatimid alliance, comprising the Hamdanid ruler of Mosul, Abu Taghlib, the Buyid ruler Izz al-Dawla, the Bedouin tribes of Banu Kilab and Banu Uqayl, and remnants of the Ikhshidid troops.
[18][19][20] An invasion of Egypt followed, but instead of making for the capital of Cairo/Fustat, the Qarmatians moved into the Nile Delta to support local anti-Fatimid rebellions, giving Jawhar time to erect fortifications at Ayn Shams, just north of Cairo, and raise additional troops.
When the Qarmatians turned south to attack Cairo, they were heavily defeated in battle on 24 December 971 and retreated all the way to Palestine, suffering heavy losses in the process.
[24][21][25] On the other hand, the failure of the Qarmatian invasion allowed the Fatimids to stabilize the situation in Egypt, so that in 973, Caliph al-Mu'izz and his court arrived from Ifriqiya and took up residence in Cairo.
Despite the considerable income afforded by the tax revenues of Egypt, and the enormous treasure with which Jawhar had set out in 969, the expenditure of stabilizing Fatimid rule, the attempted conquest of Syria and raising forces to combat the Qarmatian invasions, and not least the construction of Cairo as a new capital, had exhausted the country's financial reserves.
[32] These measures hit particularly hard on the artisan cities of the Nile Delta,[32] which had rebelled again due to high taxation in 969–970,[33] and again during the first Qarmatian invasion, a revolt that had only recently been suppressed with some difficulty.
[40][41] On 27 April, after all available manpower was mustered, al-Mu'izz's son and designated heir Abdallah led the Fatimid army out to confront the Qarmatians at the dry lake bed known as Jubb Umayra or Birkat al-Hajj, just north of Ayn Shams.
[40][42] Several eastern Arab sources attribute the Fatimid victory to the defection of the Bedouin chieftain al-Hasan ibn al-Jarrah of the Banu Tayy, who was allegedly bribed with 100,000 gold dinars.
[45] The fate of the captives varied: former Ikhshidid officers were executed, while the captured Qarmatian commanders were released after a few months, as al-Mu'izz endeavoured to enter into negotiations with them.
[46] The Fatimid victory spelled the end of the invasion: al-A'sam retreated back into Syria, but was unable to hold his position there and withdrew to Bahrayn, while in the south, Akhu Muslim dispersed his small army and barely managed to escape capture himself.
In the end the Damascenes turned for assistance to a Turkic mercenary leader, Alptakin, who had fled the turmoils of Buyid Iraq with 300 heavily armored ghulam followers and come to Syria.
[57][58] Al-Aziz then took matters into his own hand, and campaigned in person in Syria: on 15 August 978, Alptakin was defeated and captured at the Battle of Tawahin, his Turkic and Daylamite soldiers being recruited into the Fatimid army.
The Qarmatians, who still occupied Tiberias under al-A'sam's successor, Ja'far, were bought off with an annual tribute of 30,000 gold dinars, in exchange for recognizing a nominal Fatimid suzerainty and leaving Palestine.
[61] In 992, the declining Qarmatians of Bahrayn, defeated by the Buyids and restricted to their original territory, also formally recognized the political suzerainty of the Fatimid caliphs, while retaining their distinct doctrines.