Alfred Dreyfus was a Jewish captain in the French general staff, a man of spotless reputation and character accused of selling military secrets to the Germans. Convicted on duff evidence, he was exiled to flyblown Devil’s Island off the South American coast, railroaded and martyred, like Jesus, or Peter, or possibly Roman Polanski, who has spotted certain parallels between his situation and that of Dreyfus and has helpfully made a movie that may encourage us to do likewise.

I’ll leave it to finer legal minds than mine to locate possible holes in Polanski’s thesis, suffice to say that Dreyfus was never found guilty of the statutory rape of a minor. But the film itself is handsome and involving – a dogged procedural that exposes the institutionalised antisemitism of 1890s France and builds to the publication of Emile Zola’s J’accuse, an open letter to the president that lifted the lid on the whole sorry affair.

Shrewdly, Polanski keeps Dreyfus (Louis Garrel) largely in the background and focuses instead on the figure of Colonel Picquart, who is played with a set jaw and resolute stare by The Artist’s Jean Dujardin. Picquart has just been promoted to lead the office of military intelligence, inheriting the mess left behind by his syphilitic predecessor and striding the halls with his epaulettes flapping. The place, he can see, is rotten to the core, in thrall to men such as the worm-like Major Henry (Grégory Gadebois) and the weaselly Bertillon (Mathieu Amalric), a graphologist and phrenologist who is happy to say whatever the prosecution desires.

Set-up complete, An Officer and a Spy covers the ground with an iron-heeled tread, through smoke-filled rooms where burly men sit and talk. They talk through walrus moustaches and around fat cigars, incessantly chewing over the particularities of a case in order to ensure that everybody’s on side. Around halfway through, Picquart takes himself off to sit wearily in a church. He could do with some quiet; the film could as well.

With Dreyfus safely behind bars, Picquart’s attention turns towards Major Esterhazy, a suspected spy up in Rouen. At first the two cases seem entirely unrelated. Then the Colonel happens to compare Esterhazy’s handwriting with what he believed was Dreyfus’s, and the scales fall from his eyes, the penny drops with a clunk. Picquart, like the others, is no fan of the Jews. But he refuses to let an innocent man stay in jail.

Polanski’s arc of history bends slowly towards justice. At the age of 86, the director has long since abandoned the air of youthful, dancing mischief that characterised the likes of Repulsion and Rosemary’s Baby. All the same, An Officer and a Spy (adapted from the novel by Robert Harris), paints a subtly devastating portrait of the French general staff, with a stench of establishment sulphur that recalls Chinatown. It’s a solid, well-crafted piece of professional carpentry, like a heavy piece of Victorian furniture; built to last; built to be used. The longer you look at it, the more impressive it grows.