Before he was a revolutionary, Stalin was known as a poet. In 1895, aged 17 and studying for the priesthood in Georgia, a province of the tsarist empire, he took a selection of his poems to show to the country's most famous editor and national hero, Prince Ilya Chavchavadze. The prince was deeply impressed with both the poems and the poet, whom he called that "young man with the burning eyes". After looking through the verses, he chose five to publish in Iveria (an archaic name for Georgia), Russia's most fashionable and prestigious literary journal. It took someone of the young Stalin's ambition and colossal self-confidence to walk into the prince's office and offer his poems for publication.

When printed, they were widely read and much admired. They became minor Georgian classics, to be published in anthologies and memorised by schoolchildren until the 1970s (and not as part of Stalin's cult; they were usually published as "Anonymous").

The poems do not fit into the category of Hitler's badly drawn postcards. Perhaps they are closer in standard to Churchill's prose style. Stalin's singing - he was a lead adolescent tenor at the seminary - was said to be good enough for him to go professional. Here, he showed a certain talent in another craft that might have provided an alternative to politics: "One might even find reasons not purely political for regretting Stalin's switch from poetry to revolution," suggests Professor Donald Rayfield, who has translated the poems into English.

Stalin was no Georgian Pushkin. The poems' romantic imagery is derivative, but their beauty lies in the rhythm and language. Poetry remained a part of Stalin's life right up to and even during his three decades as tyrant, leading him to protect some poets and destroy others.

Chavchavadze, Stalin's patron, was a Georgian aristocrat, literary aesthete and respected writer, a romantic believer in an independent Georgia ruled by an enlightened nobility. The teenage student of the priesthood, then known as Josef "Soso" Djugashvili, was a cobbler's son from a notoriously violent provincial town who had overcome paternal beatings, street fights, several almost fatal accidents and illnesses to enter the Tiflis seminary, one of the finest educational establishments south of Moscow. It was an oppressive boarding school offering a classical and Orthodox education, not unlike an English Victorian public school. Intellectually precocious, the 10-year-old Stalin wrote verses instead of letters to his friends.

Startlingly handsome yet pockmarked, strong yet with a withered arm and webbed feet, charming and charismatic yet ruthless, he was a clever student and voracious reader yet a viciously vindictive enemy. Soso was already Stalin in the making: an atheist in the process of embracing Marxism, already at war with other students, and locked in a duel of wits with a hated priest at the seminary. The one thing he shared with the prince was a romantic vision of Georgia.

He was raised, like all Georgians, on the national epic, "The Knight in the Panther's Skin" by Shota Rustaveli, which he knew by heart. As a child, Stalin immersed himself in all the popular poems, especially those by two other aristocrats and national heroes, Prince Rafael Eristavi (his favourite poet) and Akaki Tsereteli. As an ageing dictator, he still talked endlessly about these influential literary giants. Chavchavadze, he said, "was a great writer"; while "my generation learned the poems of Tsereteli by heart and with joy ... beautiful, emotional and musical, he was rightly called the nightingale of Georgia". Once he learned Russian, he adored and memorised the poems of the radical poet Nekrasov with similar passion. At a congress in Stockholm in 1906, he burst into the room of his comrade, and later Politburo henchman, Kliment Voroshilov and energetically recited an entire Nekrasov poem.

At the seminary, the would-be priest worked on his romantic poems until he was confident enough to show them to Chavchavadze. The chosen five soon appeared in Iveria, published under his nickname "Soselo". Soselo was admired as a poet before anyone had ever heard of "Stalin", the name he did not coin until 1912. Deda Ena - the popular children's anthology of Georgian verse - included Stalin's first published poem, "Morning", in its 1916 edition, where it remained (sometimes ascribed to Stalin, sometimes not) up to the days of Brezhnev. The scans and rhymes of "Morning" work perfectly, but it was Soselo's fusion of Persian, Byzantine and Georgian imagery that won plaudits.

His next poem, a crazed ode called "To the Moon", reveals more of the poet: a violent, tragically depressed outcast, in a world of glaciers and divine providence, is drawn to the sacred moonlight. In the third work, he explores - as Rayfield puts it - the "contrast between violence in man and nature and the gentleness of birds, music and singers".

The fourth is the most revealing of all: Stalin imagines a prophet not honoured in his own country, a wandering poet poisoned by his own people. Now 17, Stalin already envisions a "paranoic" world where "great prophets could only expect conspiracy and murder". If any of Stalin's poems "contained an avis au lecteur", argues Rayfield, "it is this one".

Dedicated to Eristavi - if any of Stalin's colleagues had dedicated a youthful poem to a prince, it would have been used against them in the terror - Stalin's fifth poem was, with "Morning", his most admired, and appeared in the Socialist weekly Kvali (The Plough). Entitled "Old Ninika", its heroic sage requires both the harp to inspire and the sickle to kill. The poem affectionately describes the old hero who "dreams or tells his children's children of the past" - perhaps an idealised vision of an old Georgian like Stalin, who himself ended up sitting on his Black Sea veranda regaling youngsters with his adventures.

When, 10 years after these works were published, he was a top Bolshevik, a political god-father running a gang of hitmen and bank robbers to fund Lenin's faction, he was still proud of his poetry. An unpublished memoir from the 1905 revolution recalls a pistol-toting Bolshevik boss leading packhorses bearing guns and stolen banknotes over the mountains, cheerfully declaiming his own poems to his companions.

By 1907, he was looking to pull off a spectacular bank robbery, but he needed an "inside man". In the streets of Tiflis, he bumped into an old schoolfriend, now working as an accountant in the state bank, who declared himself a passionate fan of Soselo's poems, particularly the one dedicated to Eristavi. Stalin charmed and cultivated this admirer until he agreed to reveal the arrival by stagecoach of a million roubles. Using this information, Stalin set up the Tiflis bank robbery in which 40 people were killed and a huge sum stolen for Lenin. This secured Stalin's reputation with Lenin, who declared he was "exactly the type I need". Only in Georgia, where poetry was read passionately, would a banker risk his life and career to arrange a bloody bank robbery because he loved a man's poetry.

Stalin's early verses explain his obsessional, destructive interest in literature, as well as his reverence for - and jealousy of - poets such as Osip Mandelstam and Boris Pasternak. In 1934, Mandelstam wrote a scabrous poem attacking Stalin. The words and influence of this "Kremlin crag-dweller" and "peasant-slayer" on literature were, Mandelstam wrote, "leaden", his "fat fingers ... greasy as maggots". Stalin's rage against Mandelstam for this brave and brilliant attack was probably redoubled because it was in poetry. But ironically, the swaggering brute rightly notorious for his oafish philistinism concealed a classically educated man of letters with surprising knowledge and taste. Mandelstam was right when he said, referring to Stalin's interest in poetry, that "in Russia, poetry is really valued, here they kill for it".

The ex-romantic poet despised and destroyed modernism, but promoted socialist realism, his distorted version of romanticism. He knew Nekrasov and Pushkin by heart, read Goethe and Shakespeare in translation, and could recite Walt Whitman. He mused about the Georgian poets of his childhood. During the terror, he released a famous Georgian intellectual from prison in order to translate Rustaveli's "The Knight in the Panther's Skin" into Russian. He then edited it himself and delicately translated some of the couplets, asking modestly: "Will they do?" His translations were surprisingly fine, but he refused to be given credit for them.

Stalin also respected artistic talent, generally preferring to kill party hacks instead of brilliant poets. Hence on Mandelstam's arrest, he ordered: "Isolate but preserve." He preserved some of his favourites, such as Shostakovich, Bulgakov and Eisenstein, sometimes telephoning and encouraging them, at others denouncing and impoverishing them. Once he called Pasternak and asked about Mandelstam: "He's a genius, isn't he?" Mandelstam's tragic fate was sealed not only by his suicidal decision to mock Stalin in verse, but also by Pasternak's failure to assert that his colleague was indeed a genius. Mandelstam was sentenced not to death, but to hard labour in the gulag. Yet Stalin did save Pasternak, saying revealingly: "Leave that cloud-dweller in peace."

Stalin never publicly acknowledged his own poems. Why did he stop writing them? One answer is that, gifted as he was at poetry, he was superbly qualified for revolutionary politics in every way: Marxism was to be his religion and his poetry. As importantly, he would be a Russian statesman as well as a world revolutionary, while his poetry belonged in a small imperial province, Georgia, a parochial backwater, in a minor language. As he later told a friend: "I lost interest in writing poetry because it requires one's entire attention - a hell of a lot of patience. And in those days I was like quicksilver."

In 1949, for Stalin's official 70th birthday, the Politburo magnate and notorious chief of secret police Lavrenti Beria, a fellow Georgian, secretly commissioned the best translators of poetry, including Pasternak and Andrei Tarkovsky, to create a Russian edition of the five poems. They were not told who the author was, but one of the poets thought "this work is worthy of the Stalin Prize first rank" - though probably he had guessed the identity of the young versifier. In the midst of the project, they received the stern order, clearly from Stalin himself, to stop work. Stalin wished to be remembered by history as the supreme leader of world Marxist revolution and the ruthless Red Tsar of the Russian imperium, not as a teenage poet from Georgia.

· Young Stalin by Simon Sebag Montefiore is published by Weidenfeld & Nicolson (£25)