Here is a quote from Cesare Beccaria’s An Essay on Crime and Punishment, in which he expounds the doctrine of natural law:
Every punishment which does not arise from absolute necessity, says the great Montesquieu, is tyrannical. A proposition which may be made more general, thus. Every act of authority of one man over another, for which there is not an absolute necessity, is tyrannical. It is upon this, then, that the sovereign’s right to punish crimes is founded; that is, upon the necessity of defending the public liberty, intrusted to his care, from the usurpation of individuals; and punishments are just in proportion as the liberty, preserved by the sovereign, is sacred and valuable.
Let us consult the human heart, and there we shall find the foundation of the sovereign’s right to punish; for no advantage in moral policy can be lasting, which is not founded on the indeliable sentiments of the heart of man. Whatever law deviates from this principle will always meet with a resistance, which will destroy it in the end; for the smallest force, continually applied, will overcome the most violent motion communicated to bodies.