Should the life of a black-hearted ogre, a mass murderer who was the wickedest of the 20th-century's monsters, be quite so entertaining? In this prequel to Stalin: The Court of the Red Tsar, Simon Sebag Montefiore's Young Stalin is an almost amiable rogue, a professional twister and trickster whose venal malevolence is masked by his poems about budding roses, soaring larks and silvery full moons. The book ends before Stalin's institutionalised terror begins, so Montefiore is free to marvel at the man's 'Bedouin informality', his lack of scruple and his nimble skill at outwitting the police. If we didn't know what he became when he gained control of Russia and its empire, we might think him a beguiling, comic scapegrace, a younger, leaner Falstaff, his allure a little damaged by his chronic acne.

A Bolshevik colleague once denounced Stalin as an 'individualist': to remain autonomous and idiosyncratic in a society dedicated to the collective good counted as treason. Montefiore shows Stalin to be a compound of many individuals. He had as many selves as he had aliases and Montefiore lists dozens of these phony identities, from 'Oddball Osip' and 'Pockmarked Oska' to the baleful-sounding 'Organez Totomiants', which he adopted and discarded at will before finally settling on the identity of Stalin, the self-allegorised man of steel, impervious to the tender human feeling. Already in his childhood, he was a contradictory creature, living 'a Jekyll and Hyde existence: choirboy-cum-streetfighter, half-overdressed mummy's boy, half-urchin'.

The story Montefiore has told requires the psychological penetration and social omniscience of a great novelist. Dickens once or twice peeps over the biographer's shoulder. Stalin recruited Georgian 'caravanserai boys as a pre-pubescent revolutionary street-intelligence and courier service', which prompts Montefiore to liken him to Fagin. The shoemaker's workshop where he slaved 'in a half-flooded cellar amid the almost faecal reek of tanning leather' after being kidnapped by his brutish father inevitably recalls Dickens's blacking factory.

Only a naturalist such as Theodore Dreiser could do justice to the vile luxury of Batumi, the oil city on the Black Sea which was Stalin's first power base, with its 'reeking streets' and 'overflowing cesspools beside oozing refineries'. When Stalin gets to Baku, another blackened and debauched oil port developed by the Nobel family, who built their refinery on the site of an ancient Zoroastrian temple where magi once tended 'holy oil-fuelled flames', Montefiore is just about equal to the imaginative challenge. Here, the plutocrats built villas shaped like packs of playing cards or dragons (with the front door inside the beast's gaping jaws), while the workers were holed up in alleys littered with decaying meat and gutted dogs. Just offshore, the sea spontaneously combusted, as oil bubbled up in waves of fire. The scene makes a mute, incontrovertible case for a popular uprising.

Stalin, however, was no revolutionary. Montefiore views him as a fixer and fund-raiser, not an ideologue. Trotsky teasingly remarked that he missed the revolution altogether because he was absent from the meeting in October 1917 at which the plotters co-ordinated their coup. Stalin described politics as 'a dirty business' and he relished the bloody ordure of the trade. Montefiore calls him a gangster and likens him to the godfather of a mafia family, specialising in shakedowns, counterfeiting, extortion and protection rackets, with propagandistic journalism as a higher-minded sideline. The man of steel had a chillingly corporate attitude to the lethal methods employed by his thugs: he saw violence, Montefiore comments, as 'a useful management tool'.

Luckily for Montefiore's narrative, the money-grubber once or twice indulges in acts of derring-do, criminal-terrorist 'spectaculars' like those which al-Qaeda's scenario writers continue to dream up - a bank raid in Tiflis (now Tblisi), which provides Montefiore with his equivalent of a pre-credits opening sequence, or the piratical seizure of a treasure ship on its way from Odessa to Batumi.

Cinematic analogies are inescapable: Stalin's psychotic crony Kamo rode to the Tiflis bank in his phaeton, 'reins in one hand and firing his Mauser with the other, like a cowboy in a western'. Montefiore may not be Dickens or Dreiser, but he does write a racy, vivid biopic. Stalin the bank robber resembles James Cagney at his most revved-up; Stalin the buccaneer has the courtly panache of Errol Flynn. After the captured ship's coffers were unloaded, he ordered the sailors to row him ashore and was so pleased with their prompt compliance that he handed out 10 rouble tips.

To be Stalin, also known as the Priest, the Milkman and the Staggerer, as well as Soso, which is Montefiore's pet name for his subject, was a great acting role. Living underground, he relied on his virtuosity as a shape-changer. Like a magician, he was able to make himself disappear: during a chase, he jumped from a moving cab into a snowdrift, which altogether effaced him. He also 'scarpered' (Montefiore's jokey word) from his wife's funeral, having identified policemen among the mourners. He outwitted the police by swaddling himself in bandages and pretending to be a bedridden invalid or got himself up in the garb of a Muslim woman, obscured by a coy veil.

Having definitively rechristened himself Stalin, he designed an appropriate costume, which he wore for the rest of his life: a military tunic accessorised by a worker's cap, despite the fact that he was neither a soldier nor a proletarian.

His effrontery is shockingly, shamefully irresistible. He sent a girlfriend to deliver some documents secreted in a coffin; the rendezvous was at the cemetery and he told her to pretend to be burying a dead baby with her bare hands. Montefiore's drama is often a muddled comedy of errors. During Stalin's visit to London in 1907, he and Lenin conferred in a Finsbury pub; a detective hid in a cupboard to eavesdrop, but had nothing useful to report since he spoke no Russian.

Fictional representations of the revolution proved more lethal than the real thing. The Winter Palace was looted, not stormed, and the Petrograd firemen conscientiously boozed their way through the stocks of Chateau d'Yquem in the tsar's cellar. The mood was 'carnivalesque'. Montefiore notes that more people were hurt when Eisenstein filmed the storming of the palace in October. The revolution became a tragedy; it began, however, as a chaotic farce, with Stalin as its nihilistically jolly master of ceremonies.