Thomas Aquinas, On Kingship, in Din Bigongiari, ed., The Political Ideas of St. Thomas Aquinas, New York: Hafner Press, 1953, Book I, Ch. Six, 49-51.

     If to provide itself with a king belongs to the right of a given multitude, it is not unjust that the king be deposed or have his power restricted by that same multitude if, becoming a tyrant, he abuses the royal power. It must not be thought that such a multitude is acting unfaithfully in deposing the tyrant, even though it had previously subjected itself to him in perpetuity, because he himself has deserved that the covenant with his subjects should not be kept, since, in ruling the multitude, he did not act faithfully as the office of a king demands. Thus did the Romans, who had accepted Tarquin the Proud as their king, cast him out from the kingship on account of his tyranny and the tyranny of his sons; and they set up in their place a lesser power, namely, the consular power. Similarly Domitian, who had succeeded those most moderate emperors, Vespasian, his father, and Titus, his brother, was slain by the Roman senate when he exercised tyranny, and all his wicked deeds were justly and profitably declared null and void by a decree of the senate. Thus it came about that Blessed John the Evangelist, the beloved disciple of God, who had been exiled to the island of Patmos by that very Domitian, was sent back to Ephesus by a decree of the senate.
    If, on the other hand, it pertains to the right of a higher authority to provide a king for a certain multitude, a remedy against the wickedness of a tyrant is to be looked for from him. Thus when Archelaus, who had already begun to reign in Judaea in the place of Herod, his father, was imitating his father's wickedness, a complaint against him having been laid before Caesar Augustus by the Jews, his power was at first diminished by depriving him of his title of king and by dividing one-half of his kingdom between his two brothers. Later, since he was not restrained from tyranny even by this means, Tiberius Caesar sent him into exile to Lugdunum, a city in Gaul.
    Should not human aid whatsoever against a tyrant be forthcoming, recourse must be had to God, the King of all, Who is a helper in due time in tribulation. For it lies in his power to turn the cruel heart of the tyrant to mildness. According to Solomon: "The heart of the king is in the hand of the Lord, withersoever He will He shall turn it." He it was who turned into mildness the cruelty of King Assuerus, who was preparing death for the Jews. He it was who so filled the cruel king Nabuchodonosor with piety that he became a proclaimer of the divine power. "Therefore, he said, "I, Nabochodonosor do now praise and magnify and glorify the King of Heaven; because all His works are true and His ways judgments, and they that walk in pride He is able to abase." Those tyrants, however, whom He deems unworthy of conversion He is able to put out of the way or to degrade, according to the words of the Wise Man: "God hath overturned the thrones of proud princes and hath set up the meek in their stead." He it was who, seeing the affliction of his people in Egypt and hearing their cry, hurled Pharoah, a tyrant over God's people, with all his army into the sea. He it was who not only banished from his kingly throne the above-mentioned Nabuchodonosor because of his former pride, but also cast him from the fellowship of men and changed him into the likeness of a beast. Indeed, his hand is not shortened that He cannot free his people from tyrants. For by Isaias He promised to give his people rest from their labors and lashings and harsh slavery in which they had formerly served; and by Ezechiel He says: "I will deliver my flock from their mouth," i.e., from the mouth of shepherds who feed themselves.
    But to deserve to secure this benefit from God, the people must desist from sin, for it is by divine permission that wicked men receive power to rule as a punishment for sin, as the Lord says by the Prophet Osee: "I will give thee a king in my wrath," and it is said in Job that he "maketh a man that is a hypocrite to reign for the sins of the people." Sin must therefore be done away with in order that the scourge of tyrants may cease.