Cesare Beccaria was a criminologist most famous because of his work "An Essay on Crimes and Punishments", which set forth most of classical criminological theory.
For Cesare Beccaria, the basis of society, as well as the origin of punishments and the right to punish, is social contract. He states that punishment is justified only to defend the social contract.