With ‘Leonardo da Vinci: Painter at the Court of Milan’, the National Gallery has scored an astonishing and improbable triumph. Many museums and galleries have contemplated staging exhibitions of the paintings of the world’s most famous artist, but all have concluded that it’s impossible.

The securely attributed works are too few-14 is the generally accepted number-too fragile and far too precious to their owners ever to be lent. Or at least that was the assumption until the National Gallery, led by the exhibition’s curator, Luke Syson, announced that it had secured the loan of seven paintings.

These include the Louvre’s version of The Virgin of the Rocks, which will be shown beside the National Gallery’s for the first time-and, almost certainly, given the fragility of both works, the last time. As if that were not enough, the exhibition also includes the newly discovered Christ as Salvator Mundi, the first painting for more than a century to be accepted by scholars as a previously unknown Leonardo.

Yet what is even more impressive is the way that these spectacular loans have been devised, not simply to draw the crowds although they will, of course, do that-but to encourage us to think more deeply about Leonardo as an artist. Far more even than Michelangelo, he has come to stand as the archetype of universal genius-an anatomist, inventor and theorist pursuing his pioneering studies alone-to such a degree that the fact that he was primarily a painter operating in the commercial and courtly world of Renaissance Italy has been in danger of being forgotten.

* Give Country Life for Christmas and save up to 40%   

The exhibition focuses on the 18 years he spent in Milan at the court of Ludovico Sforza, nicknamed Il Moro (probably because of his swarthy complexion). This was the period in which Leonardo both acquired his European reputation and transformed his art in a way that, Mr Syson argues, was intimately linked with Ludovico’s cultural and political priorities.

Ludovico had seized power in 1481 in the aftermath of the assassination of his eldest brother, and, for the next 13 years, he ruled Milan as regent for his young nephew, Gian Galeazzo Sforza. Following Gian Galeazzo’s death in 1494, Ludo-vico became Duke of Milan, but he enjoyed his position for only three years before being deposed by the French king, Louis XII. As in theory only temporary ruler of Milan for most of his reign, Ludovico sought to reinforce his position by developing the prestige of his court. Leonardo, who arrived in Milan in 1482 from Florence-almost certainly as, in effect, a diplomatic gift from Lorenzo de’ Medici-played an essential role in pro-moting Ludovico as an exemplar of a Renaissance prince.

For this, Leonardo had to call on many skills beside painting: as well as devising the decor and costume for court entertainments, he developed skills in fortifications and architectural design. More ambitiously still, he offered to make a gigantic bronze equestrian statue of Ludovico’s father. As is well known, this never proceeded beyond the clay model, which was destroyed by the invading French. Less well known is the fact that considerable traces of a painted decorative scheme by Leonardo survive in Ludovico’s principal residence, Castello Sforzesco in Milan.

Leonardo’s most celebrated achievement in Milan, the mural of the Last Supper in the refectory of the Dominican convent of Santa Maria delle Grazie, also to an underrated extent had a courtly function, as Ludovico dined there twice a week, and it was thanks to pressure from him that it didn’t turn into yet another of Leonardo’s unfinished projects. Mr Syson illuminatingly interprets the ‘unblemished beauty’ of this great work ‘as a metaphor of Ludovico’s perfect rule of a perfected state’.

That beauty was-as always with Leonardo-achieved with immense thought and labour, qualities that made fresco unpalatable, as it demands speed of execution. He devised, therefore, an experimental technique using egg tempera and oil paint that proved almost immediately unstable. The Last Supper is now a noble wreck, but something of its original beauty can be glimpsed in the best early copy, an oil painting made by Giampietrino in about 1520. Owned by the Royal Academy, and usually on display in the chapel at Magdalen College, Oxford, it preserves the colour harmonies that have almost disappeared in the original.

The exhibition also brings together all the drawings by Leonardo associated with the Last Supper, most of them from the Royal Collection’s incomparable holding of his graphic work. Although we have far more writings by Leonardo than by any other contemporary artist, he had no interest in recording his own life, and the document-ation of his works is frustratingly patchy. When the sitter in a portrait was an important figure, such as Ludovico’s mistress Cecilia Gallerani, the subject of the exquisite Lady with an Ermine, we are on sure ground, but the intended owner of an equally ambitious, although unfinished, work painted in Milan, St Jerome, is a mystery.

There is also no contemporary explanation of why an artist so prone to leaving works incomplete should have painted two versions of such a large and complex painting as The Virgin of the Rocks. The exhibition’s catalogue lucidly sets out the confusing documentation, but doesn’t propose a conclusive answer.

The usual assumption is that, after a dispute about payment with the friars who, in 1483, had commissioned the work for the chapel of the Confraternity of the Immaculate Conception in the main Franciscan church in Milan, San Francesco Grande, Leonardo withdrew the painting now in Paris and sold it, but then returned in about 1490 to paint the version in London.

Technical investigation of the National Gallery’s Virgin of the Rocks in 2005 revealed underpainting that is unquestionably by Leonardo, because it shows him considering and rejecting a change in the composition. Cleaning and conservation of the panel, completed in 2010, also finally confirmed what had been doubted by some scholars, that the painting is an autograph work. As a result, we have a uniquely vivid opportunity to understand the way that Leonardo’s art had evolved in the course of a decade in ducal service in Milan.

The essentially empirical approach to depicting nature so evident in the first version had been transmuted into something more metaphysical-an emphasis on perfect beauty that is strongly evident also in the newly discovered Christ as Salvator Mundi, begun in about 1499. In these paintings, Leonardo strives to go beyond reality to embody an approach to art that he described thus: ‘The divinity which is the science of painting transmutes the painter’s mind into a resemblance of the divine mind.’

‘Leonardo da Vinci: Painter at the Court of Milan’, is at the National Gallery, London WC2 (0844 248 5097; www.nationalgallery.org.uk), until February 5, 2012