Joseph Stalin was edged into third place in a nationwide poll to name Russia's greatest historical figure yesterday amid controversy over the results.

The Name of Russia project, which captivated the country for several months, ended with accusations that the final tally was rigged.

More than 5 million votes by telephone, text and the internet were registered in the poll, which named Alexander Nevsky, a medieval warrior prince, as the winner. Stalin had led the poll early on and narrowly missed the top spot.

The dictator took 519,071 votes compared to Nevsky's 524,575.

Critics said the results were massaged to produce winners convenient to the Kremlin. Nevsky rallied Russian forces against foreign invaders in the 13th century and has been promoted as a national hero by the Kremlin, which hints that Vladimir Putin, the prime minister, and the president, Dmitry Medvedev, are unifying figures from the same mould.

In second place was Pyotr Stolypin, an early 20th century prime minister and noted reformer. Stolypin, who served under the last tsar, Nicholas II, has often been lauded by Putin as a role model whose attempts to achieve stability he would like to emulate.

Alexander Pushkin, the poet, came fourth while Catherine the Great, the only woman on the shortlist, was 11th.

Communists said the vote had been "cunningly" manipulated to prevent Stalin or first Soviet leader Lenin (who came sixth) winning because the Kremlin was embarrassed at their popularity.

In a statement, the Communist party said it had "no faith in the organisers of the voting project", who had decided Stalin and Lenin were "bad lads" who should not win. The results prompted the "same level of trust as in the central electoral commission", it said, in reference to Kremlin rigging of the presidential election in Russia earlier this year.

Launched in May, the project offered voters a chance to choose from 50 candidates, a number that was whittled down to the 12 most popular in September.

No living figures were included in the list. Alexander Solzhenitsyn, the chronicler of the gulag, was added after his death in August but attracted few votes.

Each shortlisted figure was presented by an expert in regular programmes on the state-controlled Rossiya television channel. Organisers of the project denied accusations of manipulating the vote, saying that, on the contrary, Communist sympathisers had attempted to skew results in favour of Lenin and Stalin. The project was briefly halted in July when it became clear the online polling system did not prevent lobby groups placing multiple votes.

Commentators said last night that, despite claims of organised voting, Stalin's high rating reflected popular sentiment.

An estimated 1.1 million people were sentenced to death during the Soviet leader's great terror, often on trumped-up charges. Millions more perished in labour camps or died of starvation.

But many Russians believe Stalin was a hero who launched industrialisation and saved the country from Nazi takeover in the second world war. He was presented on Name of Russia by Valentin Varennikov, a general, who said: "We became a great country because we were led by Stalin."