It is a sadness of the present age that "humanism" has become such a narrow and partisan term, effectively denoting atheism with a bit of good PR. It wasn't always like that. Machiavelli was the inheritor of a tradition of humanism that dated back to the 14th century and was far from anti-Christian.

As ever more ancient manuscripts were discovered in monastic libraries in the middle ages, a new attitude to the classical world emerged. Cicero, Tacitus, Thucydides and Lucretius were valued, not only for their rhetorical brilliance but also for their fundamentally different view of the world and, in particular, of human nature.

Humanism contended that contrary to received wisdom, formed and sustained under the shadow of St Augustine, human corruption was not total. Humans could make meaningful choices about their lives and destiny. They could be genuinely virtuous. Human dignity lay not so much in the possession of an immortal soul as in the capacity for and exercise of freedom. Fortune (which could be influenced) as opposed to Providence (which could not) became the presiding genius. Humans were made for excellence. All this was achieved within a thoroughly Christian framework. Embracing ideas of dignity, freedom and excellence did not entail rejecting Christianity, merely the Augustinian flavour of it to which most people had become accustomed.

It did, however, involve a different attitude to the world, to work and, most noticeably, to education. This was partly in who should be taught: now all gentlemen would benefit from studying, not just those destined for the church. But it was also in what should be taught. Scripture and scholasticism gave way to the thought and literature of the classical world, without which no education could be considered complete. This was, in Quentin Skinner's words, an "almost embarrassingly long-lived" idea, shaping the English educational system until the time of Harold Macmillan.

The Prince stands firmly within this tradition. The whole "mirror for princes" genre, of which it is the most famous example, although having pre-humanist roots, was a typically humanist enterprise, in particular the way it chose to affirm rather than renounce worldly ambition. Within The Prince, as with other such books of advice, examples from the ancient world dominate. "A ruler must … exercise his mind [by] read[ing] history," Machiavelli advises Lorenzo, "in particular accounts of great leaders and their achievements."

The lessons of history need not be on the individual scale. Machiavelli was fond of drawing examples from the Roman empire, explaining, for example, that its stability was rooted in how "the Romans … never put off a war when they saw trouble coming", or that its collapse was triggered "when they started hiring Goths as mercenaries". If contemporary rulers sought greatness, there was no greater example than the Roman empire.

Personal models were, however, more important. "Take as a model a leader who's been much praised and admired and keep his examples and achievements in mind at all times," Machiavelli advised. This is what ancient leaders themselves had apparently done – Alexander the Great had modelled himself on Achilles, Caesar on Alexander, Scipio on Cyrus – so it stood to reason that what was modern ones should do. The Prince is peppered with such examples, legends like Theseus and Romulus, or emperors like Marcus Aurelius, Pertinax and Alexander, "benign, humane men who led unassuming lives, loving justice and hating cruelty". It is, however, also populated by other ancient figures, who were ruthless, manipulative or plain brutal.

This in itself was not unprecedented. The tradition of learning from the mistakes and faults of others was itself an ancient one. What Machiavelli did, however, was use such moral monsters for affirmative rather than censorious purposes. These people were worth studying not because they were wrong, but because they were strong.

Thus, in the same way as he drew a positive message from the example of Cesare Borgia as we saw last week, he also wrote about emperors like Commodus, Severus, Atoninus Caracalla and Maximinus, men who were "extremely cruel and grasping", not to condemn but to learn from them.

Hannibal, for example, is lauded in a chapter about cruelty and compassion because he led "a huge and decidedly multiracial army far from home" in which there was no sign of dissent or rebellion. How? Machiavelli's answer is simple. It was his "tremendous cruelty". Stories like this illustrate how Machiavelli simultaneously used and subverted the humanist historical tradition. "Historians are just not thinking," he writes tetchily at one point, "when they praise [Hannibal] for this achievement and then condemn him for cruelty."

It was entirely right that fellow humanists should seek to learn from history. But they should at least do so honestly.