Ruling on democracy and elections and participating in that system
Question

What is the ruling on democracy and taking a leadership role in parliment or other levels of the democratical government? What is the ruling regarding voting for someone in democracy? How was the islamic state organized, and governed in the classical times?.
Praise be to Allah.Firstly: 
Democracy is a man-made system, meaning rule by the people for the people. Thus it is contrary to Islam, because rule is for Allaah, the Most High, the Almighty, and it is not permissible to give legislative rights to any human being, no matter who he is. 
It says in Mawsoo’at al-Adyaan wa’l-Madhaahib al-Mu’aasirah (2/1066, 1067): 
Undoubtedly the democratic system is one of the modern forms of shirk, in terms of obedience and following, or legislation, as it denies the sovereignty of the Creator and His absolute right to issue laws, and ascribes that right to human beings. Allaah says (interpretation of the meaning): 
“You do not worship besides Him but only names which you have named (forged) — you and your fathers — for which Allaah has sent down no authority. The command (or the judgement) is for none but Allaah. He has commanded that you worship none but Him (i.e. His Monotheism); that is the (true) straight religion, but most men know not”
[Yoosuf 12:40] 
“The decision is only for Allaah”
[al-An’aam 6:57]
End quote. 
This has been discussed in detail in the answer to question no.  98134.
Secondly: 
The one who understands the true nature of the democratic system and the ruling thereon, then he nominates himself or someone else (for election) is approving of this system, and is working with it, is in grave danger, because the democratic system is contrary to Islam and approving of it and participating in it are actions that imply apostasy and being beyond the pale of Islam. 
But as for the one who nominates himself or nominates others in this system in order to join the parliament and enjoin good and forbid evil, and establish proof against them, and reduce its evil and  corruption as much as he can, so that people of corruption and disbelievers in Allaah will not have free rein to spread mischief in the land and spoil people’s worldly interests and religious commitment, this is a matter that is subject to ijtihaad, according to the interests that it is hoped will be served by that. 
Some scholars are even of the view that getting involved in these elections is obligatory. 
Shaykh Muhammad ibn ‘Uthaymeen (may Allaah have mercy on him) was asked about the ruling on elections, and he replied: I think that elections are obligatory; we should appoint the one who we think is good, because if the good people abstain, who will take their place? Evil people will take their place, or neutral people in whom there is neither good nor evil, but they follow everyone who makes noise. So we have no choice but to choose those who we think are fit. 
If someone were to say: We chose someone but most of the parliament are not like that, 
We say: It does not matter. If Allaah blesses this one person and enables him to speak the truth in this parliament, he will undoubtedly have an effect. But what we need is to be sincere towards Allaah and the problem is that we rely too much on physical means and we do not listen to what Allaah says. So nominate the one who you think is good, and put your trust in Allaah. End quote.  
From Liqaa’aat al-Baab al-Maftooh, no. 210 
The scholars of the Standing Committee for Issuing Fatwas were asked: 
Is it permissible to vote in elections and nominate people for them? Please note that our country is ruled according to something other than that which Allaah revealed? 
They replied: 
It is not permissible for a Muslim to nominate himself in the hope that he can become part of a system which rules according to something other than that which Allaah has revealed and operates according to something other than the sharee’ah of Islam. It is not permissible for a Muslim to vote for him or for anyone else who will work in that government, unless the one who nominates himself or those who vote for him hope that by getting involved in that they will be able to change the system to one that operates according to the sharee’ah of Islam, and they are using this as a means to overcome the system of government, provided that the one who nominates himself will not accept any position after being elected except one that does not go against Islamic sharee’ah. End quote. 
Shaykh ‘Abd al-‘Azeez ibn Baaz, Shaykh ‘Abd al-Razzaaq ‘Afeefi, Shaykh ‘Abd-Allaah ibn Ghadyaan, Shaykh ‘Abd-Allaah ibn Qa’ood. 
Fataawa al-Lajnah al-Daa’imah (23/406, 407 
They were also asked: 
As you know, here in Algeria we have what are called legislative elections. There are parties which call for Islamic rule, and there are others that do not want Islamic rule. What is the ruling on one who votes for something other than Islamic rule even though he prays? 
They replied: 
The Muslims in a country that is not governed according to Islamic sharee’ah should do their utmost and strive as much as they can to bring about rule according to Islamic sharee’ah, and they should unite in helping the party which is known will rule in accordance with Islamic sharee’ah. As for supporting one who calls for non-implementation of Islamic sharee’ah, that is not permissible, rather it may lead a person to kufr, because Allaah says (interpretation of the meaning): 
“And so judge (you O Muhammad صلى الله عليه وسلم) among them by what Allaah has revealed and follow not their vain desires, but beware of them lest they turn you (O Muhammad صلى الله عليه وسلم) far away from some of that which Allaah has sent down to you. And if they turn away, then know that Allaah’s Will is to punish them for some sins of theirs. And truly, most of men are Faasiqoon (rebellious and disobedient to Allaah).
50. Do they then seek the judgement of (the days of) Ignorance? And who is better in judgement than Allaah for a people who have firm Faith”
[al-Maa'idah 5:49-50].
Hence when Allaah stated that those who do not rule in accordance with Islamic sharee’ah are guilty of kufr, He warned against helping them or taking them as allies or  close  friends, and He commanded the believers to fear Him if they were truly believers. He says (interpretation of the meaning): 
“O you who believe! Take not as Awliyaa’ (protectors and helpers) those who take your religion as a mockery and fun from among those who received the Scripture (Jews and Christians) before you, and nor from among the disbelievers; and fear Allaah if you indeed are true believers”
[al-Maa’idah 5:57]
And Allaah is the Source of strength. May Allaah send blessings and peace upon our Prophet Muhammad and his family and companions. End quote. 
Standing Committee for Academic Research and Issuing Fatwas 
Shaykh ‘Abd al-‘Azeez ibn Baaz, Shaykh ‘Abd al-Razzaaq ‘Afeefi, Shaykh ‘Abd-Allaah ibn Ghadyaan 
Fataawa al-Lajnah al-Daa’imah (1/373).