When Pierre Puvis de Chavannes exhibited The Beheading of John the Baptist at the Paris Salon of 1870, one critic described the picture as "grotesque" and another, just as insultingly but rather more accurately, as "Pre-Raphaelite". To eyes accustomed to the glossy finish of academic history painting on the one hand and to the colourful modernity of Impressionism on the other, the picture must have been difficult to categorise. Neither Realist nor fully Symbolist in style, it strikes a middle ground between conservative and progressive tendencies in French art of the period.

The subject has something in common with the melodramatic scenes of Oriental cruelty that had appeared regularly at the Salon at least since 1827, the year Delacroix exhibited his Death of Sardanapalus. But the muted colours, un-emphatic brushwork and measured distances between the figures are closer to the restraint of classical art than to the romantic excess we associate with Orientalism - a term art historians apply to 19th-century depictions of the Near East.

Puvis's contemporaries fully expected to see religious subjects such as this one exhibited at the Salon. Yet, compared with the figures in most academic paintings, those here do not fully pierce the picture plane but are flattened against its surface in a shallow frieze. Strangest of all, Puvis depicts a moment of blood-curdling violence simultaneously with one of transcendent stillness.

The scene is the stone courtyard of Herod's palace. At the vertical axis of the composition the prophet kneels facing us, his pale torso bare, his thin arms extended downwards with palms turned out in a gesture that embodies both innocence and passivity. The longer one looks, the more the fierce, beautiful head irradiated by a golden nimbus seems to float above the long, sun-burned neck that marks the exact centre of the composition, its fulcrum. The executioner has swung his scimitar over his shoulder. In a split second he will start the movement that will sever the Baptist's head from his body. Salome watches, charger in hand, stage right.

And "stage" is the correct word. Because there is no sky or horizon, the shallow box in which the scene takes place could be a theatrical set for a production of Oscar Wilde's play Salome - written long after Puvis painted his picture. Just behind the Baptist, a tree with three trunks and many branches rises up from the horizontal line where the stone floor meets the wall. Because the martyr's body obscures the roots of tree, Puvis implies that his blood will water the roots of faith. In John the Baptist's death, Christianity is born.

And this is the meaning of the picture, expressed in its juxtaposition of opposites: pagan vs Christian, east vs west, active vs passive. The full frontality of St John's pose is played off against the sidelong sweep of the muscular executioner. All the fear and fascination Western audiences felt towards the East is embodied in this figure.

In the very year that Puvis exhibited his picture, the academician Henri Regnault showed an unusually realistic depiction of a decapitation, Summary Judgement under the Moorish Kings of Granada, which graphically reiterates Puvis's theme of the implacable cruelty of the oriental. But, if the East is equated with violence, sensuality and anonymity, St John's icon-like face and fair skin embodies the gentleness, purity and truth of the Christian West. By far the weakest figure is Salome, a doll-like figurine whose expression - lust? curiosity? regret? - is impossible to read.

This picture, which belongs to the Barber Institute of Fine Arts in Birmingham, is closely related to a much larger, unfinished painting of the same subject in the National Gallery, which Puvis began in 1865, abandoned in 1869, and probably reworked in the later 1870s.

Clearly, when Puvis ran into difficulties with the London version, he corrected its infelicities in the much more successful Birmingham picture. Puvis was primarily a painter of murals and decorative cycles, and, in terms of scale, finish and its pale, light colours, the London version is closer than the Birmingham picture to the appearance of fresco painting.

In it, the Baptist turns his head slightly away from the executioner. This slight change in the Baptist's position serves to bring the picture into line with other decapitations in Western art - particularly the 17th-century Italian sculptor Alessandro Algardi's marble group, Beheading of St Paul, in Bologna's church of S Paolo Maggiore, the primary visual inspiration, I would suggest, for Puvis's composition.

As in the Birmingham picture, the Baptist kneels in the centre, but now the tree behind him is off-centre, so that the symbolism of his placement is lost. Herod and a serving woman join Salome at the right, and the Baptist holds a reed tipped with an illuminated cross, like the wand of a fairy princess. Worse, the head of Salome is thought to be a portrait of Puvis's mistress, a distractingly realistic touch in a scene that should be eternal.

There has been some debate as to the identity of Herod. He is supposed to resemble the poet Anatole France, but I have another suggestion: that he looked like the dictator Emperor Napoleon III - rather a good choice to play Herod - and a satisfying explanation as to why the picture was never finished nor exhibited in Puvis's lifetime.

Seeing the two versions at the National Gallery's small but revealing show (until Oct 27), there was no question in my mind that Birmingham's is the greater. In it, Puvis refines his first composition, taking away the "sub-plot" of the relationship between Herod and his stepdaughter and reducing the tragedy to its bare bones.

The size of the show is perfect. Although 30 preparatory studies are known, only 10 or so are exhibited, and these reveal that Puvis worked exactly as a Renaissance artist did, first making careful figure and drapery studies, and then squaring the drawings for transfer to the canvas.

It is also clear that, although he worked from nude life models for the male figures, he didn't for the females. That may be because Salome is clothed, whereas the bodies of both St John and the Executioner are shown, but it also helps us understand why the female figures are so unsuccessful.