Writing a biography of Charles Howard “Dick” Ellis, the Australian-born intelligence officer for Britain’s M.I.6 accused of being one of the worst traitors of the 20th century, was never going to be easy. He was a spy. He was secretive about his personal life. And he may or may not have been guilty of aiding and abetting not just Adolf Hitler but Joseph Stalin.

Nothing had ever been proved in that regard, despite an alleged partial confession in the 1960s. Ellis, who died in 1975, left little behind by way of papers, and his remaining family members—a daughter and granddaughter in New York—wouldn’t cooperate with me. I’d been told it was far too hard, too labyrinthine a project to even contemplate. But it was such a cracking untold story I found it impossible to resist.

There was also the small matter of what was at stake if Ellis were indeed proved guilty: Had the man who wrote the blueprint for the Office of Strategic Services (O.S.S.), the progenitor of the C.I.A., actually been a Nazi and Soviet spy at the time of the O.S.S.’s inception, in 1942? Had the birth of American intelligence been fatally compromised by a mole?

He may or may not have been guilty of aiding and abetting not just Adolf Hitler but Joseph Stalin.

Ellis was born in impoverished circumstances in Sydney, Australia, in 1895, and overcame this tough start in life to become a classical musician, scholar of Central Asia, and author of an important book on the League of Nations. He was a highly decorated soldier and military officer for Great Britain in two World Wars; he was recruited by British intelligence at Oxford University, where he was studying Russian; and he joined M.I.6 in Constantinople, what is today Istanbul.

Over the following decades, Ellis became a critically important intelligence officer in Western Europe, North Africa, North America, East Asia, and his home country of Australia, working tirelessly against the two sides he was later accused of working for: Nazi Germany and the Soviet Union.

If we are to believe the accounts of British spy-writing troika Chapman Pincher, Nigel West, and Peter Wright, Ellis was a sniveling, odious, two-faced rat of the first order, a worse villain than the treacherous Kim Philby.

There was no end to the charges made against Ellis: that either for money or after being blackmailed, he’d revealed M.I.6’s bugging of the German Embassy in London to the Nazis; betrayed two British agents to the Nazis at Venlo, on the Dutch-German border; been a key informant for Waffen-SS major general Walter Schellenberg prior to the Battle of Britain; been complicit in the Nazis’ shooting down, over the Bay of Biscay, the plane that was carrying English actor Leslie Howard; and tipped off Philby that he was under suspicion as a Soviet spy, among countless other moral atrocities involving the Nazis and Soviets.

Had the man who wrote the blueprint for the O.S.S., the progenitor of the C.I.A., actually been a Nazi and Soviet spy?

But if we are to listen to the men who worked with Ellis in America, he was an unsung hero. According to Colonel David K. E. Bruce, “American intelligence could not have gotten off the ground in World War II” without Ellis. In his 1988 book, The Secret War Against Hitler, C.I.A. director William Casey credited the Australian with establishing O.S.S. training centers in Washington, D.C.

Assistant Secretary of State Adolf Berle said it wasn’t the much-venerated William “Wild Bill” Donovan who was running the O.S.S. during W.W. II, but Ellis himself. President Franklin D. Roosevelt’s O.S.S. liaison Ernest Cuneo wrote in 1981: “British intelligence has produced many brilliant men, but none so dazzling as Dickie Ellis.... Mentally, he was gigantic. His knowledge of history, particularly of the ancient cultures and Islam, was perhaps more encyclopedic than that of his good friend H. G. Wells. He mastered not only all the major European languages, but Turkish, Urdu and Persian as well. He told me he could ‘think in Russian.’ He was an extraordinary pianist, and it was by his choice that he did not become a concert musician.”

So which of these two camps was right? Or did the actual truth of the matter lie somewhere in between? Either way, why on earth had such a titan of his age slipped through the cracks of history to be practically forgotten?

He was a spy. He was secretive about his personal life.

What followed was two years of attempting to construct Ellis’s life story from thousands of fragmentary sources. By the end of it, I was convinced the Americans were right—Ellis was indeed an unsung hero—and Pincher, West, and Wright had been badly wrong about the avuncular, peripatetic, polyglottal Australian who was awarded the Legion of Merit for his wartime services to the U.S. by President Harry Truman.

The paper trail I followed painted a picture not of a traitor but of a skilled practitioner in the dark arts of espionage, a man who expertly “played both ends against the middle” when it came to the Nazis and Soviets. To gain an advantage against the enemy, Ellis sometimes had to use the enemy. Intelligence is not a straightforward profession. It’s messy and involves subterfuge and compromise.

But Ellis was perhaps more of a hero than even the Americans dared to imagine. While researching Ellis’s intelligence activities in the period immediately before Japan’s bombing of Pearl Harbor, in December 1941, the cataclysmal event that drew the U.S. into World War II, I discovered that Ellis, through the conduit of William Stephenson, his boss at the British Security Coordination (a covert organization set up in New York in 1940 by the British Secret Intelligence Service), had passed information to the White House about the impending attack almost four months before it happened.

President Franklin D. Roosevelt preparing for a radio address two days after the Japanese attack on Pearl Harbor, in 1941.

Ellis had been advising F.B.I. boss J. Edgar Hoover on counter-espionage at the time, and was the M.I.6 handler of Serbian double agent Dusko Popov. Ellis and Popov met with the F.B.I. at the Commodore Hotel in New York on August 18, 1941, when Popov raised the first alarm about Pearl Harbor.

Said Ellis: “[Stephenson] was convinced from the information that was reaching him that this attack was imminent, and through Jimmy Roosevelt, President Roosevelt’s son, he passed this information to the President. Now whether the President at that time had other information which corroborated this … it’s impossible to say.”

Then B.S.C. agent and future author Roald Dahl said he was personally told by Stephenson that President Roosevelt had been warned. If what Ellis claimed was indeed true, and the information about Pearl Harbor was ignored, who’s the real villain of this piece?

Jesse Fink is a Bedfordshire, U.K.–based writer