And about Moses, He said: “Moses said, ‘My people, if you have believed in Allah, then put your trust in Him—if you are truly Muslims.’” 1
And about the Messiah, He said: “And [remember] when I inspired the disciples, ‘Believe in Me and in My messenger.’ They said, ‘We have believed, so bear witness that we are Muslims.’” 2
He, exalted is He, also said regarding the earlier prophets and the Torah: “By it did the prophets, who had submitted, judge for the Jews.” 3
And He said about the Queen of Sheba: “My Lord, I have truly wronged myself; I now submit, together with Solomon, to Allah, Lord of all the worlds.” 4
Thus Islam is the religion of all the Prophets. It is to surrender exclusively to Allah. Whoever surrenders to Him and to anyone else is a polytheist, and whoever refuses to surrender to Him is arrogant; both the idolater and the one too proud to worship Allah are disbelievers.
Surrendering to Allah entails worshipping Him alone and obeying Him alone. That means obeying Him at every moment by doing what He has commanded for that moment. At the beginning of Islam He ordered the believers to face Jerusalem, and later He commanded them to face the Kaʿba; both actions—each divinely ordered—belong to Islam, for religion is obedience. Both directions are acts of worship to Allah; only the outward form—the orientation of the worshipper—changed. In the same way, the messengers all share one religion, even though their respective laws, paths, expressions, and rites may differ. Such variety does not negate the oneness of the religion, just as the change from facing Jerusalem to facing the Kaʿba did not create two religions within the single law of Muhammad ﷺ.
The religion of the Prophets is one, even though their legal codes vary. Allah may legislate a ruling at one time for a wise purpose, then legislate a different ruling at another time for another wise purpose; thus, acting upon an abrogated ruling before its abrogation