Death stalks the work of Michelangelo Merisi da Caravaggio. Here was an artist drawn irresistibly to executions and corpses, dismemberment and putrefaction. He painted one gruesome martyrdom after another. Saint Matthew, run through by a sword at his own church altar. Saint Peter, nailed to an upside-down crucifix. Saint Lucy, buried on the site where a soldier cut her throat. Decapitation was a Caravaggio speciality, hence his paintings of John the Baptist and Salome, the Gorgon Medusa, Judith and Holofernes, David and Goliath.Biographers surmise that Caravaggio’s preoccupation with the separation of heads from bodies was most likely enhanced by a bando capitale death sentence served on him after he murdered a man, most probably in a duel, in 1606. It basically permitted anyone to kill him on sight.

Which brings us to Caravaggio’s last known painting, The Martyrdom of Saint Ursula, the subject of an exhibition at the National Gallery, London, that opened this week. The work was completed in Naples just weeks before the artist left for Rome, in 1610, hoping to lift the death sentence by acquiring a papal pardon. The trip would prove lethal for Caravaggio. The best guess at what happened? After getting himself arrested en route, and having all his possessions confiscated, Caravaggio died, probably of sepsis, in the small Tuscan town of Porto Ercole, where he was attempting to retrieve the three paintings he had brought with him to buy papal favor.

The Martyrdom of Saint Matthew, circa 1599–1600.

The Martyrdom of Saint Ursula shows the steadfast virgin—whose companion virgins, a host of 11,000, have presumably just been massacred offstage—contemplating the arrow to her breast, shot from point-blank range by an enraged Hunnish king. She is the still, small focus of the composition. Already bloodless and milky white as death overcomes her, Ursula is well on her way to sainthood. The painting was commissioned by Marcantonio Doria, a powerful Genoese aristocrat whose stepdaughter—significantly—had taken the name Ursula when she entered a nunnery.

Medusa, circa 1598.

The life of this painting included an appreciable period of time when it wasn’t even considered a Caravaggio. In 1972, it was purchased by an Italian bank as a work attributed to Mattia Preti, a 17th-century “Caravaggisti” who was born two years after Caravaggio died. The discovery of letters in the Naples State Archive, written by Doria’s agent and detailing the acquisition and dispatch of the Ursula painting (including an ill-advised attempt to dry the still-damp varnish in the sun, which only made things worse), confirmed that, in fact, it was a Caravaggio after all.

Judith Beheading Holofernes, circa 1599.

From a painter who liked to sneak into his own works, another little detail sings out. Over Ursula’s left shoulder, caught in a beam of light, is a face that looks a lot like Goliath’s severed head as well as the onlooker in The Martyrdom of Saint Matthew: Caravaggio himself.

“The Last Caravaggio” is on at the National Gallery, in London, until July 21

Andrew Pulver writes about film for The Guardian and about art for The Art Newspaper. He lives in Oxford