Niccolò Machiavelli said this quote

... On the whole, the best fortress you can have, is in not being hated by your subjects. If they hate you no fortress will save you...