The greatness of an artist has never been more overwhelmingly demonstrated. The exhibition Leonardo da Vinci: Painter at the Court of Milan at the National Gallery reveals, in an intimate, sensitive way, the stupendous quality of Leonardo as a painter and draughtsman. I got another chance to see it this week, and was more impressed still with the insightful and imaginative way it has been curated.

Yet Leonardo was not just a wondrous artist. He was also a wonderful man. Anyway this is what his first biographers claimed in the 16th century, and this week in our interactive series on Leonardo's drawings we present evidence that he was admirable, not just in the terms of his own time, but according to our attitudes today. Long before such ideas were widespread, let alone fashionable, he defended the rights of animals.

As a child in the 1970s I had a Ladybird book about the lives of great artists. The artist who fascinated me in it was Leonardo – I cannot even remember who the others were. What I most vividly remember is a picture in the Ladybird book of Leonardo releasing a bird he had just bought at market from its cage, while amazed bystanders look on. This illustrates a claim in Giorgio Vasari's life of Leonardo, first published in 1550. Vasari says the genius so loved animals that he bought caged birds – sold in Italy at that time as food, as well as pets – simply to let them go.

It sounds like a wild bit of hagiography. It obviously associates Leonardo with the image of Saint Francis of Assisi, who preached a sermon to the birds and – as shown by the painter Sassetta in the National Gallery collection – negotiated peace between the people of Gubbio and a wolf.

But – as the quotations from Leonardo's notebooks in our interactive guide to his drawings of a dog's paw show – Vasari was not making this one up. Whether or not Leonardo really set birds free, he definitely did question the superiority of humans to the rest of the animal kingdom. It is a repeated theme in his notebooks. He writes in them that humanity is not "king of the animals" but merely "king of the beasts", that is, a more powerful beast than the rest: and he goes on to rage that we use our power to raise animals for slaughter. Warming to his theme, he points out that none of the other animals do what some humans do, and eat their own species – he was writing this at a time when the Florentine explorer Vespucci (or someone using his name) published sensational stories of cannibalism in the New World.

Leonardo da Vinci's assertion that we are animals, and do not have any God-given right to eat our fellow creatures, was totally at odds with the culture of his age. As the historian Keith Thomas has narrated, interpretations of Genesis in his time aggressively declared that animals are created for human use. Only in the 18th century did more sensitive attitudes become widespread.

Leonardo is an exception – in this as in so many other fields. It would be wrong to reduce him just to a predecessor of modern ecology – in my book about him I show that his relationship with nature looks backward as well as forward, relating him to shamanism in the world of medieval peasants. Yet his incomparable imagination let him anticipate our own debates today. A letter to his patron Giuliano de' Medici actually refers to "our Leonardo da Vinci" as someone who refused to eat meat. It is further evidence that Vasari's saintly image of Leonardo the liberator of animals is rooted in reality. We are dazed by the paintings. If we explore his notes and the early stories of his life, we are equally amazed by the man.