Allah ﷻ says:
يَا دَاوُودُ إِنَّا جَعَلْنَاكَ خَلِيفَةً فِي الْأَرْضِ فَاحْكُم بَيْنَ النَّاسِ بِالْحَقِّ وَلَا تَتَّبِعِ الْهَوَىٰ فَيُضِلَّكَ عَن سَبِيلِ اللَّـهِ
“O David, verily, We have made you a Vicegerent in the land; so judge between mankind with the Truth and do not follow desires, as it will lead you astray from the Path of Allah.” (Sura 38: 26)
King David was granted the favor of becoming the King of Israel and his progeny ruled over Israel and Judea for many generations as kings, i.e., the Davidic dynasty. The Israelites had always wanted God to grant them a monarchy so that they could be strengthened. This is parallel to the contemporary Muslim yearning for the establishment of a Caliphate. This is why Allah ﷻ refers to King David as a ‘Khalifa’ He had established in the Earth. The function of the Caliphate is to judge between mankind with truth and justice. So long as it fulfills this responsibility it will be favored by God, but once it descends into despotic behavior ‘following desires’ it will have become astray from the Path of God and then subject to a ‘severe punishment’ (Sura 38: 26). After King Solomon, the Israelite kingdom was divided in two, and the northern kingdom was destroyed by the Assyrians in the late 8th century BCE. The southern kingdom persisted, but it too came to an end during the Babylonian captivity at the head of the 6th century BCE and the last Davidic king of Judah was Zedekiah. The glad-tidings of a Messiah was given to the Israelites, someone through whom God would restore the Davidic dynasty and restore the glory remnicient of Kings David and Solomon (peace be upon them both). As Muslims we believe that Davidic Messiah, the ‘Branch of Jesse’ and ‘Lion of Judah’ was Jesus of Nazareth (peace be upon him). Yet the Jews, under the toxic influence of their corrupt religious leaders, rabbis and priests, rejected their Messiah. Likewise, Allah established the Caliphate for the Mohammedan dispensation through the Prophet’s right-hand man and senior most disciple, Abu Bakr. This caliphate was not hereditary, but it too was based on judging between mankind with truth and justice. However, this Caliphate upon the Prophetic Model, or Khilafat ‘alal-Minhaj al-Nubuwwa, only lasted a brief period – 30 years. Then the despotic Umayyads seized power, followed by the Abbasids, then various Turkic and Mamluk dynasties until the Muslims were overtaken by colonialism. Hence the promised ‘severe punishment’ (Sura 38: 26) visited the Muslims too, as it had visited the Israelites through the agency of the Assyrians, Babylonians and Romans. But for the Muslims, the ‘severe punishment’ was through the agency of the Turks, Mongols, Tatars (Gog & Magog), through the agency of the Crusaders, and most recently, through the agency of European colonialism. Muslims not only lost their Rightly-Guided Caliphate upon the Prophetic Model, but they even lost dominion over the land as the various Muslim dynasties, despite being despotic, were destroyed through the agency of the Golden Horde (Mongols) and through European colonialism. Now just as a Davidic Messiah was promised to restore the Davidic dynasty, so too a Fatimid Mahdi has been promised to the Muslims from the progeny of the Prophet Muhammad through his daughter Fatima (peace be upon them). In fact, the restoration of the Davidic caliphate through the Messiah of Nazareth is still a divine promise which is going to be fulfilled, but it will be for the benefit of the Muslim Believers and not the atheist and faithless Zionists. Likewise, a Fatimid and Alawite government will be established through the promised Mahdi some time before the second coming of the Messiah.