Were All Prophets Muslims?
Question

Islam is a great religion with its rituals and values, but it was the last religion to appear. I wonder: why did it not appear in the beginning, from the time of Sayyiduna Adam (peace be upon him)? Was there any prayer or anything like that for which a person would be punished if he did not do it?
Praise be to Allah.Perhaps this confusion arises in one who thinks that the religion of Islam is separate from the previous divinely-revealed messages . This is an idea that the Jews and Christians have tried to spread and propagate. But the clear facts of the Quran confirm that Islam is a religion that perfects the religions that came before it, and that what the Prophet (blessings and peace of Allah be upon him) and what the previous Prophets were sent with all comes from the same source, namely divine revelation which brought the light of guidance and happiness to humanity.
Allah, may He be Glorified and Exalted, says (interpretation of the meaning):
{Muhammad is not but a messenger. [Other] messengers have passed on before him.} [Al `Imran 3:144]
{Indeed, the religion in the sight of Allah is Islam .} [Al `Imran 3:19]
{Say, “I am not something original among the messengers, nor do I know what will be done with me or with you. I only follow that which is revealed to me, and I am not but a clear warner”.} [Al-Ahqaf 46:9]
The believers who followed the earlier prophets were all Muslims in a general sense, and they will enter Paradise by virtue of their Islam. If any of them lived until the mission of the Prophet (blessings and peace of Allah be upon him) began, nothing would have been accepted from him except following the Prophet (blessings and peace of Allah be upon him).
Shaykh Al-Islam Ibn Taymiyah (may Allah have mercy on him) said:
“Whoever was a follower of the teachings of the Torah or the Gospel which had not been altered or abrogated, then he was a follower of the religion of Islam, such as those who followed the teachings of the Torah without alteration before the Messiah (peace be upon him) was sent, and those who followed the teachings of the Gospel without alteration before Muhammad (blessings and peace of Allah be upon him) was sent." (Majmu‘ Al-Fatawa  27/370)
As Allah, may He be Glorified and Exalted, has told us that the religion with Him is Islam, and that there is no Messenger but He sent him to his people to call them to Tawhid (affirmation of His oneness), which is Islam [in its general sense], then it is clear to us that the only religion which Allah loves His slaves to follow is Islam, which is based on Tawhid and the six pillars of faith, and on the values of truth, justice and virtue. This is the religion with which Adam (peace be upon him) was sent, and with which the last of the prophets and messengers, Muhammad (blessings and peace of Allah be upon him) was sent.
Allah, may He be Glorified and Exalted, says (interpretation of the meaning):
{And We sent not before you any messenger except that We revealed to him that, “There is none is worthy of worship except Me, so worship Me”} [Al-Anbiya’ 21:25]
Abu Hurayrah (may Allah be pleased with him) said: The Messenger of Allah (blessings and peace of Allah be upon him) said: “I am the closest of the people to ‘Isa son of Maryam in this world and the Hereafter. The Prophets are half-brothers; their mothers are different but their religion is one.” Narrated by Al-Bukhari, 3443 and Muslim, 2365)
Ibn Hajar (may Allah have mercy on him) said:
“What this Hadith means is that the foundation of their religion is one and the same, namely Tawhid (affirmation of Allah’s oneness), even though some minor juristic issues differed." (Fath Al-Bari,  6/489)
Dr. ‘Umar Al-Ashqar (may Allah have mercy on him) said:
“Islam, in the language of the Quran, is not the name of a specific religion; rather it is the name of the common religion to which all the Prophets called people. Hence Nuh (peace be upon him) said to his people:
{and I have been commanded to be of the Muslims.} [Yoonus 10:72 - interpretation of the meaning]
Islam is the religion which Allah enjoined on the father of the prophets, Ibrahim (peace be upon him):
{When his Lord said to him, “Submit,” he said “I have submitted [in Islam] to the Lord of the worlds”.} [Al-Baqarah 2:131 - interpretation of the meaning]
Both Ibrahim and Ya‘qub (peace be upon them) advised their sons, saying:
{“… so do not die except while you are Muslims,”} [Al-Baqarah 2:132 - interpretation of the meaning]
The sons of Ya‘qub responded to their father by saying:
{We will worship your God and the God of your fathers, Abraham and Ishmael and Isac - one God. And we are Muslims [in submission] to Him.} [Al-Baqarah 2:133 - interpretation of the meaning]
Musa (peace be upon him) said to his people:
{O my people, if you have believed in Allah , then rely upon Him, if you should be Muslims } [Yunus 10:84 - interpretation of the meaning].
The Disciples said to ‘Isa (peace be upon him):
{We have believed in Allah and testify that we are Muslims [submitting to Him].} [Al `Imran 3:52 - interpretation of the meaning]
When a group of the People of the Book heard the Quran,
{they say, “We have believed in it; indeed, it is the truth from our Lord . Indeed we were, [even] before it, Muslims [submitting to Allah]”} [Al-Qasas 28:53 - interpretation of the meaning]
Islam is a common term that has been repeated by the prophets and their followers since the earliest historic times until the time of Prophet Muhammad (blessings and peace of Allah be upon him)." (Ar-Rusul wa’r-Risalat,  p. 243)
But the laws of the earlier prophets and messengers – meaning the juristic rulings – are what were abrogated and changed with the coming of the leader of the messengers, Muhammad (blessings and peace of Allah be upon him). Allah, may He be Glorified and Exalted, chose him to bring the perfect law that is suitable for every time and place, and He commanded all people to follow that law and leave what they used to follow of the laws of the earlier messengers.
In fact, these scholars have affirmed that what has been abrogated of the laws of the earlier messengers is some details; as for the basic guidelines of the laws, and their main principles and foundations, they are all the same and are agreed upon.
Ash-Shatibi (may Allah have mercy on him) said:
“Islam did not abrogate the general principles that deal with what is necessary, what is needed and what is required for enhancement [And they did not change from one Prophet to another]. Rather abrogation affected some minor issues, as may be understood from examining the systems of law that came before Islam. The scholars of Usul [principle rules of Fiqh] claim that the principles dealing with necessities are included in every previous system of law, and that is also applicable to needs and enhancements. Allah, may He be Exalted, says (interpretation of the meaning):
{He has ordained for you of religion what He enjoined upon Noah and that which We have revealed to you, [O Muhammad], and what We enjoined upon Abraham and Moses and Jesus - to establish the religion and not be divided therein.} [Ash-Shura 42:13]
{So be patient, [O Muhammad], as were those of determination among the messengers.} [Al-Ahqaf 46:35]
And He, may He be Exalted, says, after mentioning many of the Prophets (peace be upon them):
{Those are the ones whom Allah has guided, so from their guidance take an example.} [Al-An‘am 6:90 - interpretation of the meaning]
And He, may He be Exalted, says (interpretation of the meaning):
{But how is it that they come to you for judgement while they have the Torah, in which is the judgement of Allah?} [Al-Ma’idah 5:43]." (Al-Muwafaqat  3/365)
Dr. ‘Umar Al-Ashqar (may Allah have mercy on him) said:
“The one who examines the systems of law [of all the Messengers] will find that they are agreed on basic matters. We have quoted above the texts which say that Allah prescribed for earlier nations prayer, Zakah, Hajj, seeking provision by lawful means, and so on. The differences between them were only in some details, so the number of prayers, their conditions and essential parts, the rates of Zakah, the locations of rituals and so on may have differed from one system of law to another, and Allah may have permitted something in one system of law for a reason, and prohibited it in another system of law for another reason." (Ar-Rusul wa’r-Risalat, p. 250)
The point here is that Islam is the religion of all the Prophets . It appeared at the beginning of Prophethood, from the time of our father Adam (peace be upon him), and all the messages called to Islam (submission to Allah) in terms of belief and basic rulings, such as the rulings on prayer, fasting, Zakah (obligatory charity) and Hajj (pilgrimage). All of these rulings were found among the earlier nations. Allah, may He be Exalted, tells us about His Prophet Isma‘il (peace be upon him):
{And he used to enjoin on his people prayer and Zakah and was to his Lord pleasing.} [Maryam 19:55 - interpretation of the meaning]
The evidence that fasting was prescribed for previous nations is the verse in which Allah, may He be Exalted, says (interpretation of the meaning):
{O you who have believed, decreed upon you is fasting as it was decreed upon those before you that you may become righteous.} [Al-Baqarah 2:183]
Hajj was prescribed since the time of Ibrahim (peace be upon him). Allah, He be Glorified and Exalted, says (interpretation of the meaning):
{And proclaim to the people the Hajj [pilgrimage]; they will come to you on foot and on every lean camel; they will come from every distant pass.} [Al-Hajj 22:27]
With regard to the differences in some rulings or some details, this is in accordance with what Allah wanted from His slaves at that time, as the previous systems of law were temporary and were prescribed for a particular time, according to what was in the people’s interests and what was best to rectify their condition at that time.
And Allah knows best.