Leonardo da Vinci was a genius of delay, a master of the unfinished.

Brilliant ideas swirled around him like snowflakes in a flurry and melted almost as quickly. Frustrated patrons tried in vain to get him to complete commissions, but the perfectionist wouldn’t be hurried. Unfinished work seemed to be a Leonardo specialty, and as the last decade of the 15th century dawned, he had frustratingly little to show for the prodigious talent he had displayed in his youth. “Tell me if anything was ever done,” he lamented in a notebook.

With that track record, an observer might have been dubious about the commission that came Leonardo’s way late in 1494 or early in 1495: to paint a mural of the Last Supper of Jesus and his apostles on the north wall of the refectory at the convent of Santa Maria delle Grazie in Milan.

Ross King, an English novelist and historian, tells the story, in “Leonardo and the Last Supper,” of the improbable creation of one of art’s greatest masterpieces. With a fiction writer’s feel for character, King depicts a supremely ingenious, enigmatic, stubbornly independent and underachieving Leonardo, and, with a nonfiction writer’s skill, he sets the sketch against a richly described background of a society in creative and often violent ferment.

King has visited the Italian Renaissance before, most notably in “Brunelleschi’s Dome” (2000), a finely wrought account of the construction of the great vault that crowns the cathedral of Santa Maria del Fiore in Florence.

This time, King tells a tale tinged with irony.

“The Last Supper” commission was not one that Leonardo sought; he may not even have wanted it. He had been working on a giant equestrian statue of Francesco Sforza, father of the reigning duke of Milan, Lodovico Sforza, Leonardo’s principal patron. That project effectively ended in 1494 when Lodovico took the 75 tons of bronze destined for the monument and used it to make three urgently needed cannon instead — “a sad irony,” King writes, given Leonardo’s “dreams of constructing instruments of war.”

As if the loss of the equestrian project wasn’t enough, Leonardo may have thought the Last Supper commission didn’t play to his skills, or at least didn’t match his interests. The phrase “things assigned, not my art” appears in a fragmentary letter to Lodovico that King speculates “may well have concerned the new assignment at Santa Maria delle Grazie.”

Leonardo had good reason to be unenthusiastic about “The Last Supper.”

“A commission to paint a wall was not the most obvious assignment for Leonardo,” King writes. “In fact, he was an odd choice for the job.” He had never worked in fresco, the preferred technique of the day for painting murals. And he had never worked on a painting so large: 15 feet tall and nearly 29 feet wide.

Nevertheless, he undertook the job, probably because he had little choice. The commission likely came from Lodovico, a man Leonardo would have wanted to keep happy. Even if the assignment came instead from the Dominican friars who lived at Santa Maria, the duke was clearly interested in the project. This time, Leonardo finished what he started, although he took about four years and managed to go slowly enough to annoy the leader of the Dominican community.

“Coming in the midst of so much dereliction and neglect, ‘The Last Supper’ was the triumphant discharge of the debt that (Leonard’s) genius owed history,” King writes, perhaps a little grandiosely. Leonardo was probably happy just to get something done. The work is “a landmark in painting …,” King continues, the gateway to the age of Michelangelo and Raphael, when artists “worked in a magnificent and intellectually sophisticated style emphasizing harmony, proportion, and movement.”

The Leonardo who emerges in King’s pages may have been a genius, but he was a refreshingly human one. “Lacking much in the way of a formal education, he was one of history’s great autodidacts,” King writes, yet he was “a poor mathematician, often making mistakes” and had difficulty with Latin: “That one of history’s greatest brains struggled with amo, amas, amat should be a consolation to anyone who has ever tried to learn a second language.”

Physically, Leonardo was “strikingly handsome and elegant,” according to early biographers. He was reputedly strong enough to be “able to straighten a horseshoe with his bare hands” and loved flashy clothing.

As he did in “Brunelleschi’s Dome,” King guides us through the artistic practices of the day, explaining the technique of fresco, which Leonardo had not learned as a young artist and apparently had no interest in learning as an older one. Fresco, which involved painting on wet plaster, required quick work. Leonardo liked to go slowly and to experiment.

“He preferred to work at a more leisurely pace than fresco required, concerning himself with subtle effects — modulations of color or transitions of light and shade — that fresco’s requisite speed of execution made virtually impossible,” writes King. Leonardo’s decision to use oil paints on a dry wall may have suited him, but it also made “The Last Supper” a flaking piece of endangered art within 20 years of its completion.

Nor does King neglect the dangerous political world in which Leonardo lived, a landscape littered with names that have become bywords for ruthlessness — Borgia, Machiavelli, Medici. One fascinating digression recounts Leonardo’s friendship with the Franciscan friar Luca Pacioli, a brilliant mathematician remembered as the “Father of Accounting.”

King judges “The Last Supper” to be “arguably the most famous painting in the world, its only serious rival Leonardo’s other masterpiece, the Mona Lisa.” That’s obviously one person’s opinion (“Starry Night,” anyone? “Guernica”? “The Night Watch”?) But wherever you rank it, “The Last Supper” is an amazing work of art and King’s book a worthy account of its beginnings.