The below statement is mentioned in Quran about most of the prophets. “I was ordered to be the first of the Muslims and: I was ordered not be a polytheist.” [En’am Surah (6/14]
“He does not have any partner. I was ordered so and I am the first of the Muslims.” [En’am Surah (6/163]
“In factwe, since we are the first of the believers,we hope that our God will forgive our sins.” [Şuara Surah (26/51]
“And I, was ordered to be the first of Muslims.” [Zumer Surah (39/12]
In these verses different Prophets say “I was ordered to be the first of Muslims”. According to Quran every prophet is Muslim. Since Prophet Adam Allah inspired Islam to all prophets and asked them to be Muslims. But after death of every prophet the polytheists added thousands of sins to the religion and almost worshiped the prophets, just as they worshipped their so called religious leaders. That is the reason why Allah kept on sending prophets.
On contrary to what the atheists believe, the prophets were not sent to impose bans and fight against the atheists, but they were sent to unveil the frauds realized via using the religion by the polytheists whom the atheists hated and thought were Muslims and invite them to worship only one Allah.
For instance when Prophet Mohammed came and invited the people in Saudi Arabia to Islam the polytheists there told that they were following the path of Prophet Ibrahim. So the verse below was sent:
Tell to them: “Allah said the truth. So obey the religion of Ibrahim as persons who acknowledge one Allah. He was not a polytheist.” [Âli Imran Surah (3/95]
The answer of the question is:Every prophet is the first Muslim of his era. Because most of the people are polytheists and some are deniers.
As a result, the first Muslim is also the first prophet who is Adam. But according to the logic of Quran, all of the prophets sent are the first Muslims of their people… When we take into consideration this simple logic we see that there is no any contradiction between the verses of Quran…