His father was dogged by accusations he was a spy throughout his career and after his death was identified by the MI5 historian, Prof Christopher Andrew, based on KGB files, as one of the Soviet Union's most important agents.

Costello and his openly left-wing views first came to the attention of MI5 while he was studying at Cambridge in 1930s, in an era when Kim Philby and his spy ring were recruited by the Soviets.

His political sympathies cost him a teaching post at Exeter University, but that did not stop him getting a job four years later with New Zealand's Department of External Affairs as second secretary at the Legation in Moscow.

Dr Richard Dunley, a records specialist at the National Archives in Kew, said Costello was reputed to have informed the New Zealand prime minister he was "a little bit left wing" only to be told: "Oh well, it won't hurt us to have one or two communists in Moscow".

MI5 was horrified Costello had been appointed to such a sensitive post, but when they tried to raise their concerns with the Dominions Office, they had to admit the case against him was "a thin one".

Dr Dunley said the files showed Britain repeatedly tried to have Costello removed, but New Zealand said it would not fire one of its most able diplomats without evidence.