In April 1945, when Adolf Hitler died by his own hand in the rubble of Berlin, nobody was much interested in what he had once believed. That was to be expected. War is no time for reflection, and what Hitler had done was so shattering, and so widely known through images of naked bodies piled high in mass graves, that little or no attention could readily be paid to National Socialism as an idea. It was hard to think of it as an idea at all. Hitler, who had once looked a crank or a clown, was exposed as the leader of a gang of thugs, and the world was content to know no more than that.

Half a century on, there is much to be said. Even thuggery can have its reasons, and the materials that have newly appeared, though they may not transform judgement, undoubtedly enrich and deepen it. Confidants of Hitler. such as the late Albert Speer, have published their reminiscences; his wartime table-talk is a book; early revelations like Hermann Rauschning's Hitler Speaks of 1939 have been validated by painstaking research, and the notes of dead Nazis like Otto Wagener have been edited, along with a full text of Goebbels's diary.

It is now clear beyond all reasonable doubt that Hitler and his associates believed they were socialists, and that others, including democratic socialists, thought so too. The title of National Socialism was not hypocritical. The evidence before 1945 was more private than public, which is perhaps significant in itself. In public Hitler was always anti-Marxist, and in an age in which the Soviet Union was the only socialist state on earth, and with anti-Bolshevism a large part of his popular appeal, he may have been understandably reluctant to speak openly of his sources. His megalomania, in any case, would have prevented him from calling himself anyone's disciple. That led to an odd and paradoxical alliance between modern historians and the mind of a dead dictator. Many recent analysts have fastidiously refused to study the mind of Hitler; and they accept, as unquestioningly as many Nazis did in the 1930s, the slogan "Crusade against Marxism" as a summary of his views. An age in which fascism has become a term of abuse is unlikely to analyse it profoundly.

Download the new Independent Premium app Sharing the full story, not just the headlines

His private conversations, however, though they do not overturn his reputation as an anti-Communist, qualify it heavily. Hermann Rauschning, for example, a Danzig Nazi who knew Hitler before and after his accession to power in 1933, tells how in private Hitler acknowledged his profound debt to the Marxian tradition. "I have learned a great deal from Marxism" he once remarked, "as I do not hesitate to admit". He was proud of a knowledge of Marxist texts acquired in his student days before the First World War and later in a Bavarian prison, in 1924, after the failure of the Munich putsch. The trouble with Weimar Republic politicians, he told Otto Wagener at much the same time, was that "they had never even read Marx", implying that no one who had failed to read so important an author could even begin to understand the modern world; in consequence, he went on, they imagined that the October revolution in 1917 had been "a private Russian affair", whereas in fact it had changed the whole course of human history! His differences with the communists, he explained, were less ideological than tactical. German communists he had known before he took power, he told Rauschning, thought politics meant talking and writing. They were mere pamphleteers, whereas "I have put into practice what these peddlers and pen pushers have timidly begun", adding revealingly that "the whole of National Socialism" was based on Marx.

That is a devastating remark and it is blunter than anything in his speeches or in Mein Kampf.; though even in the autobiography he observes that his own doctrine was fundamentally distinguished from the Marxist by reason that it recognised the significance of race - implying, perhaps, that it might otherwise easily look like a derivative. Without race, he went on, National Socialism "would really do nothing more than compete with Marxism on its own ground". Marxism was internationalist. The proletariat, as the famous slogan goes, has no fatherland. Hitler had a fatherland, and it was everything to him.

Yet privately, and perhaps even publicly, he conceded that National Socialism was based on Marx. On reflection, it makes consistent sense. The basis of a dogma is not the dogma, much as the foundation of a building is not the building, and in numerous ways National Socialism was based on Marxism. It was a theory of history and not, like liberalism or social democracy, a mere agenda of legislative proposals. And it was a theory of human, not just of German, history, a heady vision that claimed to understand the whole past and future of mankind. Hitler's discovery was that socialism could be national as well as international. There could be a national socialism. That is how he reportedly talked to his fellow Nazi Otto Wagener in the early 1930s. The socialism of the future would lie in "the community of the volk", not in internationalism, he claimed, and his task was to "convert the German volk to socialism without simply killing off the old individualists", meaning the entrepreneurial and managerial classes left from the age of liberalism. They should be used, not destroyed. The state could control, after all, without owning, guided by a single party, the economy could be planned and directed without dispossessing the propertied classes.

That realisation was crucial. To dispossess, after all, as the Russian civil war had recently shown, could only mean Germans fighting Germans, and Hitler believed there was a quicker and more efficient route. There could be socialism without civil war.

Now that the age of individualism had ended, he told Wagener, the task was to "find and travel the road from individualism to socialism without revolution". Marx and Lenin had seen the right goal, but chosen the wrong route - a long and needlessly painful route - and, in destroying the bourgeois and the kulak, Lenin had turned Russia into a grey mass of undifferentiated humanity, a vast anonymous horde of the dispossessed; they had "averaged downwards"; whereas the National Socialist state would raise living standards higher than capitalism had ever known. It is plain that Hitler and his associates meant their claim to socialism to be taken seriously; they took it seriously themselves.

For half a century, none the less, Hitler has been portrayed, if not as a conservative - the word is many shades too pale - at least as an extreme instance of the political right. It is doubtful if he or his friends would have recognised the description. His own thoughts gave no prominence to left and right, and he is unlikely to have seen much point in any linear theory of politics. Since he had solved for all time the enigma of history, as he imagined, National Socialism was unique. The elements might be at once diverse and familiar, but the mix was his.

Hitler's mind, it has often been noticed, was in many ways backward-looking: not medievalising, on the whole, like Victorian socialists such as Ruskin and William Morris, but fascinated by a far remoter past of heroic virtue. It is now widely forgotten that much the same could be said of Marx and Engels.

It is the issue of race, above all, that for half a century has prevented National Socialism from being seen as socialist. The proletariat may have no fatherland, as Lenin said. But there were still, in Marx's view, races that would have to be exterminated. That is a view he published in January-February 1849 in an article by Engels called "The Hungarian Struggle" in Marx's journal the Neue Rheinische Zeitung, and the point was recalled by socialists down to the rise of Hitler. It is now becoming possible to believe that Auschwitz was socialist-inspired. The Marxist theory of history required and demanded genocide for reasons implicit in its claim that feudalism was already giving place to capitalism, which must in its turn be superseded by socialism. Entire races would be left behind after a workers' revolution, feudal remnants in a socialist age; and since they could not advance two steps at a time, they would have to be killed. They were racial trash, as Engels called them, and fit only for the dung-heap of history.

That brutal view, which a generation later was to be fortified by the new pseudo-science of eugenics, was by the last years of the century a familiar part of the socialist tradition, though it is understandable that since the liberation of Auschwitz in January 1945 socialists have been eager to forget it. But there is plenty of evidence in the writings of HG Wells, Jack London, Havelock Ellis, the Webbs and others to the effect that socialist commentators did not flinch from drastic measures. The idea of ethnic cleansing was orthodox socialism for a century and more.

So the socialist intelligentsia of the western world entered the First World War publicly committed to racial purity and white domination and no less committed to violence. Socialism offered them a blank cheque, and its licence to kill included genocide. In 1933, in a preface to On the Rocks, for example, Bernard Shaw publicly welcomed the exterminatory principle which the Soviet Union had already adopted. Socialists could now take pride in a state that had at last found the courage to act, though some still felt that such action should be kept a secret. In 1932 Beatrice Webb remarked at a tea-party what "very bad stage management" it had been to allow a party of British visitors to the Ukraine to see cattle-trucks full of starving "enemies of the state" at a local station. "Ridiculous to let you see them", said Webb, already an eminent admirer of the Soviet system. "The English are always so sentimental" adding, with assurance: "You cannot make an omelette without breaking eggs." A few years later, in 1935, a Social Democratic government in Sweden began a eugenic programme for the compulsory sterilisation of gypsies, the backward and the unfit, and continued it until after the war.

The claim that Hitler cannot really have been a socialist because he advocated and practised genocide suggests a monumental failure, then, in the historical memory. Only socialists in that age advocated or practised genocide, at least in Europe, and from the first years of his political career Hitler was proudly aware of the fact. Addressing his own party, the NSDAP, in Munich in August 1920, he pledged his faith in socialist-racialism: "If we are socialists, then we must definitely be anti-semites - and the opposite, in that case, is Materialism and Mammonism, which we seek to oppose." There was loud applause. Hitler went on: "How, as a socialist, can you not be an anti-semite?" The point was widely understood, and it is notable that no German socialist in the 1930s or earlier ever sought to deny Hitler's right to call himself a socialist on grounds of racial policy. In an age when the socialist tradition of genocide was familiar, that would have sounded merely absurd. The tradition, what is more, was unique. In the European century that began in the 1840s from Engels's article of 1849 down to the death of Hitler, everyone who advocated genocide called himself a socialist, and no exception has been found.

The first reactions to National Socialism outside Germany are now largely forgotten. They were highly confused, for the rise of fascism had caught the European left by surprise. There was nothing in Marxist scripture to predict it and must have seemed entirely natural to feel baffled. Where had it all come from? Harold Nicolson, a democratic socialist, and after 1935 a Member of the House of Commons, conscientiously studied a pile of pamphlets in his hotel room in Rome in January 1932 and decided judiciously that fascism (Italian-style) was a kind of militarised socialism; though it destroyed liberty, he concluded in his diary, "it is certainly a socialist experiment in that it destroys individuality". The Moscow view that fascism was the last phase of capitalism, though already proposed, was not yet widely heard. Richard remarked in a 1934 BBC talk that many students in Nazi Germany believed they were "digging the foundations of a new German socialism".

By the outbreak of civil war in Spain, in 1936, sides had been taken, and by then most western intellectuals were certain that Stalin was left and Hitler was right. That sudden shift of view has not been explained, and perhaps cannot be explained, except on grounds of argumentative convenience. Single binary oppositions - cops-and-robbers or cowboys-and-indians - are always satisfying. The Molotov-Ribbentrop pact was seen by hardly anybody as an attempt to restore the unity of socialism. A wit at the British Foreign Office is said to have remarked that all the "Isms" were now "Wasms", and the general view was that nothing more than a cynical marriage of convenience had taken place.

By the outbreak of world war in 1939 the idea that Hitler was any sort of socialist was almost wholly dead. One may salute here an odd but eminent exception. Writing as a committed socialist just after the fall of France in 1940, in The Lion and the Unicorn, Orwell saw the disaster as a "physical debunking of capitalism", it showed once and for all that "a planned economy is stronger than a planless one", though he was in no doubt that Hitler's victory was a tragedy for France and for mankind. The planned economy had long stood at the head of socialist demands; and National Socialism, Orwell argued, had taken from socialism "just such features as will make it efficient for war purposes". Hitler had already come close to socialising Germany. "Internally, Germany has a good deal in common with a socialist state." These words were written just before Hitler's attack on the Soviet Union. Orwell believed that Hitler would go down in history as "the man who made the City of London laugh on the wrong side of its face" by forcing financiers to see that planning works and that an economic free-for-all does not.

At its height, Hitler's appeal transcended party division. Shortly before they fell out in the summer of 1933, Hitler uttered sentiments in front of Otto Wagener, which were published after his death in 1971 as a biography by an unrepentant Nazi. Wagener's Hitler: Memoirs of a Confidant, composed in a British prisoner-of-war camp, did not appear until 1978 in the original German, and arrived in English, without much acclaim, as recently as 1985. Hitler's remembered talk offers a vision of a future that draws together many of the strands that once made utopian socialism irresistibly appealing to an age bred out of economic depression and cataclysmic wars; it mingles, as Victorian socialism had done before it, an intense economic radicalism with a romantic enthusiasm for a vanished age before capitalism had degraded heroism into sordid greed and threatened the traditional institutions of the family and the tribe.

Socialism, Hitler told Wagener shortly after he seized power, was not a recent invention of the human spirit, and when he read the New Testament he was often reminded of socialism in the words of Jesus. The trouble was that the long ages of Christianity had failed to act on the Master's teachings. Mary and Mary Magdalen, Hitler went on in a surprising flight of imagination, had found an empty tomb, and it would be the task of National Socialism to give body at long last to the sayings of a great teacher: "We are the first to exhume these teachings." The Jew, Hitler told Wagener, was not a socialist, and the Jesus they crucified was the true creator of socialist redemption. As for communists, he opposed them because they created mere herds, Soviet-style, without individual life, and his own ideal was "the socialism of nations" rather than the international socialism of Marx and Lenin. The one and only problem of the age, he told Wagener, was to liberate labour and replace the rule of capital over labour with the rule of labour over capital.

These are highly socialist sentiments, and if Wagener reports his master faithfully they leave no doubt about the conclusion: that Hitler was an unorthodox Marxist who knew his sources and knew just how unorthodox the way in which he handled them was. He was a dissident socialist. His programme was at once nostalgic and radical. It proposed to accomplish something that Christians had failed to act on and that communists before him had attempted and bungled. "What Marxism, Leninism and Stalinism failed to accomplish," he told Wagener, "we shall be in a position to achieve."

That was the National Socialist vision. It was seductive, at once traditional and new. Like all so- cialist views it was ultimately moral, and its economic and racial policies were seen as founded on universal moral laws. By the time such conversations saw the light of print, regrettably, the world had put such matters far behind it, and it was less than ever ready to listen to the sayings of a crank or a clown.

That is a pity. The crank, after all, had once offered a vision of the future that had made a Victorian doctrine of history look exciting to millions. Now that socialism is a discarded idea, such excitement is no doubt hard to recapture. To relive it again, in imagination, one might look at an entry in Goebbels's diaries. On 16 June 1941, five days before Hitler attacked the Soviet Union, Goebbels exulted, in the privacy of his diary, in the victory over Bolshevism that he believed would quickly follow. There would be no restoration of the tsars, he remarked to himself, after Russia had been conquered. But Jewish Bolshevism would be uprooted in Russia and "real socialism" planted in its place - "Der echte Sozialismus". Goebbels was a liar, to be sure, but no one can explain why he would lie to his diaries. And to the end of his days he believed that socialism was what National Socialism was about.

The Lost Literature of Socialism by George Watson is published by Lutterworth, pounds 15