A phantom hangs over Ireland’s relations with Hitler’s Germany. Since Eamon de Valera’s visit to the Third Reich’s minister to Ireland on 2 May 1945, the spectre of pro-Nazism has dogged Ireland’s reputation. De Valera’s condolences on the suicide of the German head of state, Adolf Hitler, spawned immediate international condemnation. He gifted his critics all the ammunition that they desired to stigmatise Ireland.

Irish enovoy to Berlin Charles Bewley: anti-Semitic and Anglophobic. Photograph: Getty Images

The notorious character and conduct of Charles Bewley, the Irish minister to Germany in the 1930s, would appear to substantiate this unkind depiction. Arriving in Berlin in July 1933 after Hitler’s seizure of power, he betrayed a lack of professionalism time after time. Disturbing signs of his anti-Semitism, dogmatic Anglophobia and insolence are clear throughout his career from the early 1920s. After 1933 he engaged in an unashamed charm offensive to curry favour with the Nazi regime. During his accreditation ceremony with President von Hindenburg, Bewley referred to the “national rebirth of Germany” in an unconcealed endorsement of Nazism. During his tenure, he recurrently endorsed Nazism as a safeguard against the expansion of Soviet Communism. He downplayed or apologised for the reprehensible Nazi regime’s negative features such as the persecution of Jews, the suppression of Christianity and its aggressive expansionism.

However, Bewley was not alone. Joseph P Walshe, the Secretary of the Department of External Affairs, was momentarily deceived by the intoxicating atmosphere of national reinvigoration that he found when he visited Cologne in 1933. He enthused about Germany’s “great experiment”. Sections of the British and American conservative elites were also misled into believing that Hitler was an indispensable tonic for the chaos that Germany experienced during the Weimar Republic before 1933. Was Hitler the leader to renew Germany? Perhaps he could be tamed to serve useful purposes? Many respectable commentators thought Adolf Hitler was a necessary defence against the “red threat” of Josef Stalin’s Soviet Union. Mussolini had reversed Italy’s dreadful fortunes after the Great War and crushed its communist virus. Why should Hitler not be afforded the same space to remedy Germany’s misfortunes? A prevalent view was that the Treaty of Versailles had unjustly humiliated Germany, stripping it of territory and forcing it to pay shameful reparations on the spurious grounds that it had caused the Great War.

Joseph P Walshe, Secretary of the Department of External Affairs, was deceived by the intoxicating atmosphere of national reinvigoration that he found when he visited Cologne in 1933

Walshe, de Valera and others in Dublin were quickly disabused of any mistaken admiration they might have held for Nazism. De Valera’s depiction as a half-caste Jew in a German newspaper in July 1933, coupled with the deprecation of Irish republicanism as part of a Jewish world conspiracy in other Nazi publications, resulted in an Irish protest to the German Foreign Office. Many unsettling incidents brought the pitiless and grotesque nature of Nazi rule to the attention of the Irish authorities, Bewley’s effort to deconstruct and dull any adverse representations of Nazi Germany notwithstanding. Bewley surprisingly downplayed evidence of Nazism’s hostility towards Catholicism but the Irish government, press and public were not misled by Nazi propaganda in this and several other respects.

Regardless, in Irish republican circles there was an enduring belief that Germany was predisposed to sympathy with Ireland’s struggle. Had both states not suffered from imposed post-conflict settlements (the Versailles Treaty of 1919 and the Anglo-Irish Treaty, 1921)? Such an outlook contended they had a common interest in righting the wrongs of the interwar order. Since the late 19th century, Irish revolutionaries had seen Germany as a prospective ally to assist their drive for independence. Such reasoning stirred Roger Casement’s doomed efforts to solicit German aid for the 1916 Rising, and this pattern continued after Irish independence. Germany was viewed as a military and economic counterpole to British influence, and the high quality products of its modern firms were sought for Irish industrialisation.

In practice, after 1933 de Valera’s Ireland operated a dual-track policy. While a policy of non-interference in, or no comment on, German domestic affairs operated, equally de Valera sympathised with Germans’ nationalist grievances against the Versailles Treaty. Ireland accepted successive faits accomplis by Hitler, such as the German withdrawal from the League of Nations (1933), rearmament, the remilitarisation of the Rhineland (1936), and the absorption of Austria (1938). Thinking in realpolitik terms, de Valera floated an arrangement with Germany in 1934 to divide Irish foreign trade evenly between Germany, Britain and the US. He supported British prime minister Neville Chamberlain’s efforts to appease Adolf Hitler, most memorably during the Munich Crisis of September 1938.

Looked at from another perspective, perhaps de Valera and other members of the political elite were tempted to believe that the appeasement of Nazi Germany worked to Ireland’s advantage? The Anglo-Irish Treaty of 1938, which ended the Anglo-Irish economic war and returned the treaty ports (Queenstown/Cobh, Lough Swilly and Castletown Berehaven) to Ireland, was heavily inspired by Chamberlain to secure Britain’s western flank. If the appeasement of Hitler failed and an Anglo-German war broke out, Britain needed a friendly western neighbour. In a way, therefore, Nazi Germany served de Valera’s interests admirably. Not only that, if Hitler’s case for the inclusion of all ethnic Germans within a “Greater Germany” was tolerated, did this not strengthen de Valera’s case to end Irish partition?

However, in the final analysis, de Valera drew the line in 1939. The Irish Government did not recognise the German annexation of the rump Czechoslovakia in March 1939. Hitler’s employment of force, coupled with the absence of a German national claim on these regions, crossed the Rubicon. Until late 1938, the retention of Bewley may have served de Valera’s purposes, but the baring of Hitler’s true intent and Bewley’s unabashed apologia for the Hitlerite excesses transformed him into a liability. Worse, in an irrevocable bout of insubordination, Bewley criticised de Valera’s foreign policy as pro-British, anti-Irish and anti-German. He had to go. De Valera hastily prepared the ground for neutrality as the war clouds gathered over Europe.

Irish exchange students and Hitler Youth in Berlin, 1936. Photograph: Getty Images

Brexit is simply the latest episode in the enduring test that Irish national leaders perennially face as they seek to balance Britain and Germany. For a small and marginal state struggling to sustain its identity and autonomy, and avoid being crushed between these two poles of European power politics or dominated by either, this has been a taxing proposition ever since 1922. Common British, German and Irish membership of the European Union was the ideal strategic and commercial solution, but Brexit threatens to resurrect independent Ireland’s Anglo-German conundrum.

Ireland, Germany and the Nazis: Politics and Diplomacy, 1919-1939 by Mervyn O’Driscoll is published by Four Courts Press. Mervyn O’Driscoll is senior lecturer in history at University College Cork. He is a member of the advisory committee for the Dictionary of Irish biography and serves as chair of the Royal Irish Academy’s standing committee for international affairs