Who Are the Sabians?
Question

The Sabians are mentioned in several verses of the Quran. Who were they? What was the religion they followed?
Praise be to Allah.Reference to Sabians in the Quran
The Sabians are mentioned in three places in the Quran. The first is the verse in which Allah says (interpretation of the meaning): 
“Verily, those who believe and those who are Jews and Christians, and Sabians [wa’l-sabi-in ], whoever believes in Allah and the Last Day and does righteous good deeds shall have their reward with their Lord, on them shall be no fear, nor shall they grieve.” [al-Baqarah 2:62]
The second is the verse in which Allah says (interpretation of the meaning): 
“Verily, those who believe (in Allah and in His Messenger Muhammad), and those who are Jews, and the Sabians [wa’l-sabi-in], and the Christians, and the Majus, and those who worship others besides Allah; truly, Allah will judge between them on the Day of Resurrection. Verily, Allah is over all things a Witness.” [al-Hajj 22:17]
And the third is the verse in which Allah says (interpretation of the meaning): 
“Surely, those who believe (in the Oneness of Allah, in His Messenger Muhammad and all that was revealed to him from Allah), and those who are the Jews and the Sabians [wa’l-sabiun] and the Christians, — whosoever believed in Allah and the Last Day, and worked righteousness, on them shall be no fear, nor shall they grieve.” [al-Maidah 5:69]
Meaning of the Sabians 
The word sabi (Sabian) is derived from the verb saba-a which refers to the action of leaving one religion and entering another. 
Al-Tabari said: 
“Al-sabiun is the plural of sabi, which means one who has changed his religion, such as an apostate from Islam who has left his religion, or anyone who leaves the religion that he used to follow and joined another. The Arabs called such a person sabi… And it is said in Arabic saba-at al-nujum meaning the stars appeared…” (Tafsir al-Tabari, 2/145; Lisan al-‘Arab under the heading saba-a) 
Beliefs of the Sabians
With regard to the beliefs of the Sabians, Ibn al-Qayyim (may Allah have mercy on him) said: 
“The people differed greatly concerning the Sabians, and the imams were unsure about them because they did not have enough knowledge of their beliefs and religion. Al-Shafi’i (may Allah have mercy on him) said: They are a kind of Christian. And he said elsewhere: Their case is to be examined further; if they resemble the Christians in basic matters but they differ from them in some minor issues, then the jizyah is to be taken from them. But if they differ from them in basic issues of religion then their religion cannot be approved of by taking the jizyah from them. 
With regard to the views of the salaf concerning them, Sufyan narrated from Layth that Mujahid said: They are a people who come between the Jews and the Magians and have no religion. In Tafsir Shayban it is narrated that Qatadah said: The Sabians are a people who worship the angels. 
Ibn al-Qayyim said: 
“I said: The Sabians are a large nation among whom are both blessed and doomed. They are one of the nations who are divided into believers and disbelievers, for the nations before the coming of the Prophet (peace and blessings of Allah be upon him) were of two types, kafir nations all of whose people were doomed and among whom were none who were blessed, such as the idol-worshippers and the Magians; and others who were divided into those who were blessed and those who were doomed, namely the Jews, Christians and Sabians. Allah has mentioned the two types in His Book, where He says (interpretation of the meaning): 
“Verily, those who believe and those who are Jews and Christians, and Sabians [wa’l-sabi-in ], whoever believes in Allah and the Last Day and does righteous good deeds shall have their reward with their Lord, on them shall be no fear, nor shall they grieve.” [al-Baqarah 2:62]
And He says something similar in al-Maidah. And in Surat al-Hajj He says (interpretation of the meaning): 
“Verily, those who believe (in Allah and in His Messenger Muhammad), and those who are Jews, and the Sabians [wa’l-sabi-in], and the Christians, and the Majus, and those who worship others besides Allah; truly, Allah will judge between them on the Day of Resurrection. Verily, Allah is over all things a Witness.” [al-Hajj 22:17]
He did not say here: those among them who believed in Allah and the Last Day, because He mentioned alongside them the Magians and those who worship others besides Allah. So He mentioned six nations, among whom are two who are doomed and four who are divided into the doomed and the blessed. When He promised the reward to those who believed and did righteous deeds, he mentioned four nations and no more. In the verse which speaks of the judgement between the nations He included these two nations with them, and in the verse which speaks of the promised reward He did not include them. Thus it is known that the Sabians included both believers and disbelievers, both doomed and blessed. 
This is an ancient nation which existed before the Jews and Christians and they were of different types: Sabians who were hanifs (monotheists) and Sabians who were mushrikun (polytheists). Their kingdom was in Haran, before the time of the Messiah. They wrote books and had knowledge. There were many of them in Baghdad, including Ibrahim ibn Hilal al-Sabi, the author of al-Rasail. He followed their religion but he fasted Ramadan with the Muslims. Most of them were philosophers and wrote famous essays which were mentioned by the scholars who wrote about philosophy and religion. 
In brief, they did not reject the Prophets or regard it as obligatory to follow them. In their view, whoever followed (the Prophets) is blessed and saved, and whoever follows a path similar to that of the Prophets by virtue of his own reasoning is also blessed and saved, even if he did not follow the Prophets in specific terms. In their view the call of the Prophets was true but there was no one specific route to salvation. They believed that the universe had a Creator and Sustainer, Who is Wise and above any resemblance to created beings, but many of them, or most of them, said: we are unable to reach Him without intermediaries, so we have to approach Him through the mediation of spiritual and holy who are pure and free of any physical elements and who are above place and time, rather they are created pure and holy.  
Then he mentioned that they used to worship these intermediaries and seek to draw close to them, and they said, “These are our gods and intercessors with the Lord of lords and God of gods.” 
Then he said: This is some of what was narrated by the scholar who studied religion and philosophy about the religion of the Sabians, and is based on what had come down to them. But among this nation are some who believe in Allah and His names and attributes, His angels and Messengers and the Last Day; and among them are disbelievers. There are some who took from the religion of the Messengers whatever suited their own reasoning and ideas of what is good, so they followed it and were content with it. 
Basically, they took what they thought was good from other religions, and they did not take the people of one religion as friends and others as enemies; they did not favour one religion over another. In their view all religions served some purpose in this world, so there was no sense in their fighting one another, rather the good things in each were to be adopted so as to perfect the human condition. Hence they were called sabi-in  because they refrained from following any one particular religion. Hence more than one of the salaf said: They are not Jews or Christians or Magians. 
There are two types of Sabians: the monotheistic Sabians (sabiah hunafa’) and polytheistic Sabians (sabiah mushrikun). The monotheists are the ones who are saved and there were debates among them, and one group refuted the view of the other. These are the people of Ibrahim as the Jews were the people of Musa, and the monotheists among them were his followers.” (Ahkam Ahl al-Dhimmah, 1/92-98)
What he mentioned about the Sabians being divided into monotheists and polytheists was confirmed by Shaykh al-Islam in more than one place. See al-Radd ‘ala al-Mantiqiyyin, 287-454; 290-458; Minhaj al-Sunnah, 1/5. See also the discussion by Shaykh Ibn ‘Ashur on this issue, in his commentary on the verse from al-Baqarah.
For more, please see these answers:  300 , 220687 , and 45525 .
And Allah knows best.