The following is excerpted from Ibn Taymiyyah Expounds on Islam: Selected Writings on Islamic Faith, Life and Society – Compiled and Translated by Muhammad ‘Abdul-Haqq Ansari [published 1421 H/2000 CE]
[Some amendments have been made to the translations of Qur’anic verses and ḥadīths]
The purpose of political authority is to subject the whole of human life to Allah and to make His word supreme. It is to accomplish this purpose that Allah has created man, revealed Books, and sent Messengers. It is for this purpose also that the Messengers and those who believed in them have striven and waged wars. Allah has said, “I have only created jinns and humankind that they may worship Me” (51:56); “Nor sent We any messenger before you save inspiring to him: ‘Verily there is no god but I, so worship Me alone’” (21:25); “We assuredly sent amongst every people a messenger (with the command): ‘Worship Allah, and eschew evil’” (16:36). Allah has put the message of all the messengers in these words, “Worship and serve (i‘budū) Allah, you have no god but Him” (7:59, 63, 73, 85; 11:50, 61, 84).
We worship and serve Allah when we obey Him and obey His Messenger [ﷺ]. This idea is also conveyed by words such as good, virtue, piety, equity, devotion, righteousness and noble conduct. To be sure, these words differ to some extent in their meanings, but we cannot go into it at the present. It is with the same object in view that the Believers have been asked to fight the people. Allah has commanded, “Fight them until there is no more fitna (disbelief) – and devotion will be entirely to Allah” (8:39). The Ṣaḥīḥayn have a ḥadīth reported by Abu Musa Al-Ash‘ari that the Prophet [ﷺ] was asked which one fights in the cause of Allah, the one who fights to demonstrate his bravery, the one who fights to defend the honour of his tribe, or the one who wants to earn a name. He replied, “The one who fights in order to make the word of Allah supreme.” 
People cannot secure the good of this world or the next unless they work together, cooperate among themselves and strive together for their cause. Through cooperation and mutual assistance they achieve the good they want and ward off the evil they hate. That is why man is social by nature. When they join hands they secure what is good for all and avoid what is evil for all. For the same purpose they submit together to an authority, without which they cannot live
Allah has sent His Messenger, Muhammad ﷺ, to mankind, guided him to the best Way, given him the best Law, and revealed to Him the best Book. He has sent him to the best of the people whom He has raised for mankind, whom He has given the most perfect of all dīns, and upon whom He has completed His blessings. He has reserved His Paradise for those who believe in Him and in His revelation. He will not be accepting any dīn from anyone other than the dīn of Islam that He has brought. Every other dīn will be rejected by Allah and its adherents will only be losers.
Allah has said in His Book that He has sent down the scripture and Iron so that the people may pursue the path of justice. His words are: “Verily have We sent Our messengers with unmistakably clear proofs; And sent down with them the scripture and the true scale, that mankind may champion justice; and We have sent down Iron, in which is (material for) mighty war, and boundless benefits for mankind; And most of all that Allah may openly know whoever aids His cause and that of His messengers, though He is unseen; Verily Allah is insuperable of might, invincible” (57:25).
That is why the Prophet [ﷺ] has commanded his community to appoint rulers who can manage their affairs, and has enjoined upon the rulers to assign various offices to those who deserve them, and to rule over the people with justice. He has also commanded the masses to obey their rulers when they obey Allah. He has said, “Whenever three of you are traveling, let one of you be the leader (amīr).”  This ḥadīth has been recorded by Abu Dawud in his Sunan, on the authority of Abu Sa‘īd, as well as Abu Hurayrah. Ahmad has noted in his Musnad another ḥadīth on the authority of ‘Abdullah ibn ‘Amr. The Prophet [ﷺ] said, “If three of you are in an open land you must put a leader upon yourselves.”
Now if the Prophet [ﷺ] has commanded us to put up a leader when we are a very small party of three, we are to do so all the more when we are more. That is why to accept a government office, considering it as a religious obligation and discharge its duties to the best of one’s abilities, seeking only the pleasure of Allah, is one of the noblest and most meritorious acts. Imam Ahmad has noted in his Musnad that the Prophet ﷺ said, “The most beloved of all to Allah is the ruler (imām) who is just, and the most detestable of all to Him is the ruler who is unjust.” 
[Ibn Taymiyyah, Fatāwā 28:61-5. Translated in Ansari, op. cit., pp. 500-502]
To administer the affairs of society is one of the greatest duties of the dīn; without performing that duty we cannot secure the good of this life or the good of the next. Men cannot be happy unless they form a society and cooperate with one another to fulfil their needs. And they cannot manage their society unless they put up an authority over them. The Prophet [ﷺ] has instructed, “If three of you go out on a journey make one of yourselves your leader.”  Abu Dawud has recorded this ḥadīth on the authority of Abu Sa‘id as well as Abu Hurayrah. Imam Ahmad has noted in his Musnad the ḥadīth reported by ‘Abdullah ibn ‘Amr that the Prophet [ﷺ] said, “If any three of you are in open land appoint a leader from among you and obey him.”  He has thus made it incumbent on us that we establish a leader over the smallest social group, even though it is temporary and lasts only for a short time. Obviously, it is all the more incumbent on larger and more permanent communities. Further, Allah has commanded us to enjoin the good and forbid the evil, and this duty cannot be rendered without power and authority. Likewise, all other social duties such as jihād, maintaining peace and order, justice, organizing ḥajj and ‘īd festivals, redressing abuses, helping the oppressed, enforcing the ḥudūd, and so on, cannot be carried out without political power and authority. That is why a prophetic ḥadīth says, “The ruler (sulṭān) is the shadow of Allah on earth.”  And it has been said: “Sixty years under an unjust imām is better than one night without an imām.” History is a sufficient witness to this truth.
This is also the reason why the Elders (Salaf) like Fudayl Ibn ‘Iyad and Ahmad ibn Hanbal used to say, “Had we only one prayer which Allah would like to grant we would have prayed for a good ruler.” The Prophet [ﷺ] said, “Allah loves three things: that you worship Him and associate none with Him, that you hold together the rope (i.e. dīn) of Allah and not be divided amongst yourselves, and that you give good counsel to those to whom Allah has entrusted your affairs.” (This has been recorded by Muslim in his Ṣaḥīḥ.) The Prophet also said, “No Muslim should ever make light of three things: seeking the pleasure of Allah in all that one does, good counsel to those who manage the people’s affairs, and solidarity with the community since its prayers protect those who adhere to it.”  This ḥadīth has been reported by the compilers of the Sunan works. In the Ṣaḥīḥ collections we have it that the Prophet said, “The dīn is good counsel, the dīn is good counsel, the dīn is good counsel.” “To whom, Messenger of Allah?” people asked. He said, “To Allah, to His Book, to His Messenger (that is to give good counsel sincerely according to what is enjoined by Allah), and to the leaders of the Muslims, as well as the masses.” 
Political authority (imārah) must, therefore, be taken as (a part of) the dīn and sought as a means to secure Allah’s pleasure and favour. Seeking Allah’s pleasure through it by pursuing His will and complying with the injunctions of His Messenger [ﷺ] in its exercise is one of the most meritorious acts. It proves detrimental only to those people who seek by it nothing but power and money. Ka‘b ibn Malik narrates that the Prophet [ﷺ] once said, “Two hungry wolves will not cause more havoc to a flock of sheep than a man can do to his dīn who seeks through it money and honour.”  At-Tirmidhi, who has recorded this ḥadīth, observes that it is authentic or fairly authentic (ḥasan ṣaḥīḥ). The Prophet [ﷺ] has made it very clear that greed for money and power plays havoc with his dīn just as or more than the havoc which two hungry wolves may cause to a flock of sheep. Allah has depicted the sorrowful fate of the one who will be given his scroll of deeds in his left hand. “(He will say:) ‘My wealth availed me nothing soever; My sovereign power has perished away from me’” (69:28-9).
The end of one who runs after power will be like the end of Pharaoh, and the fate of one who hankers for money will be like the fate of Qarun. Allah has referred to the end of both men in His Book, where He has said, “Or have they not journeyed on earth and just looked how was the end of all who came before them, while they were stronger than themselves in might, and in edifices so great that their traces are still left across the earth; Yet Allah took them for their sins; And they had no one to shield them from Allah” (40:21); and, “That incomparable final abode have We made for those who want no haughty supremacy on earth or any corruption; and the final issue is to the godfearing” (28:83).
When power and money are put at the service of Allah and to further His cause they will bring happiness in this world as well as the next. But if power is dissociated from dīn or dīn from power, the condition of the people is bound to deteriorate. The difference between the righteous and the wicked, the God-fearing and the God-defying, concerns intention as well as action, the Prophet [ﷺ] said, “Allah will not look at your faces, nor at your property and wealth; He will look at your hearts and deeds.” 
When money and honour become the moving force for the people in authority, they deviate from faith and fortify themselves in their jurisdiction. Many people think that there is necessarily a conflict between power on the one hand and faith and honest religious life on the other. Of them, some prefer the dīn and keep away from things without which the dīn cannot be complete. Others consider those things to be necessary and discard the dīn in the belief that they cannot have both together. They just discard the dīn to become an object of pity and disdain, devoid of any honour and authority. This is why when many men of dīn are not able to live up to their dīn and have to suffer in their struggle to establish it. They begin to think that their approach is not right or cannot be effective, and that they cannot secure their own well-being or the well-being of others.
Both groups are wrong: those who choose the path of the dīn but fail to take it to completion, since they do not have power, or cannot carry out jihād, or do not have money for it, as well as those who strive for power and money, and wage war for it, but have no plan to establish the dīn (iqāmat ad-dīn) with it. Both these ways are pursued by people who incur the wrath of Allah and stray from truth: the former being the way of the Christians that strayed from truth, and the latter the way of the Jews who had the wrath of Allah as their portion. The right path is the path of the prophets, the most true (in their faith), the martyrs, and the righteous. It is the path of Prophet Muhammad [ﷺ], the caliphs who succeeded him, his Companions, and those who followed in their footsteps. It is the path of the first Muhājirūn and Anṣār, and of those who followed them truly and correctly. May Allah be pleased with them and may they be pleased with Allah, and may He give them the gardens of Paradise under which rivers will flow to live in them forever; that is really the great success.
Every Muslim should work for this end as much as he can. If he is appointed to a position of authority and uses his powers to serve Allah, to establish His dīn, and promote the well-being of the Muslims as much as he can by performing sincerely the duties which are enjoined upon him and by refraining from the things which are forbidden, he will not be questioned for what he could not do. Certainly it is good for the ummah to appoint to public office people who are righteous rather than wicked…
To establish the dīn and maintain it on the correct lines two things are needed, the Book that guides and the Iron that defends, as Allah has said.
It is, therefore, the duty of every Muslim to bring the Qur’an and the Iron together in the cause of Allah, as well as pray for His help. Goods of the world may be used for the dīn. Mu‘adh ibn Jabal said, “Son of Adam, you need the good of this world, but you need much more the good of the next world. Hence, if you begin with the good of the next world, you engage also in the good of this world and accomplish it properly. But if you begin with the good of this world you will miss the good of the next world and will also risk the good of this world.” This is endorsed by a ḥadīth of the Prophet recorded by al-Tirmidhi: “One who begins his day caring first for his next life, Allah will set his affairs right, grant him peace and tranquility of the heart, and the world will come to him with its head down. But if one begins the day thinking first for this world, Allah will let his efforts go in different directions, and let poverty stare him in the eye, and nothing of the world will come to him except what is written for him.”  The essence of this truth has been stated in the Qur’an: “Nor have I created jinn and humankind, but to worship Me. I want no provision from them, nor want them to give me food; Verily Allah is the Ever-Providing; the insuperably Powerful of Indestructible Might” (51:56-8).
[Ibn Taymiyyah, Fatāwā 28:390-7. Translated in Ansari, op. cit., pp. 503-508]
 Al-Bukhari #7458, Muslim #1904, Ibn Majah #2783, al-Nasa’i #3136 and al-Tirmidhi #1646
 Abu Dawud #2608, #2609 (ḥasan ṣaḥīḥ)
 Musnad of Imam Ahmad, II:177
 Musnad of Imam Ahmad, III:22, al-Tirmidhi #1329 (ḥasan) and al-Nasa’i #2576 (ṣaḥīḥ)
 See Note 2
 See Note 3
 A version of this ḥadīth, narrated by Abu Bakrah (r), is related by al-Tabarani and is graded ḥasan. Scholars have differed about the authenticity of this narration. See here.
 Muslim #1715, al-Muwaṭṭa of Imam Malik, book 56 ḥadīth 20 and Musnad of Imam Ahmad, II:327, 360 and 367
 Narrated by Jubayr ibn Mut‘im (r) in Ibn Majah #3056 and al-Darimi #233. Also narrated by Zayd ibn Thabit (r) in Ibn Majah #230 and the Ṣaḥīḥ of Ibn Hibban. In addition it has been narrated by ‘Abdullah ibn Mas‘ud – al-Tirmidhi #2658. Grade: ṣaḥīḥ.
 Al-Bukhari #57 and Muslim #55
 Al-Tirmidhi #2376
 Muslim #2564, Ibn Majah #4143 and Musnad of Imam Ahmad, II:285 and 529
 Narrated by Anas ibn Malik (r) in al-Tirmidhi #4265 (ṣaḥīḥ) and Musnad of Imam Ahmad, V:183