A high-ranking Nazi officer who helped develop a mobile gas chamber became a spy for West Germany after World War II, archives have revealed.
Former SS officer Walther Rauff worked for West German intelligence service, the BND, between 1958 and 1962.
In hindsight, his recruitment was "politically and morally incomprehensible", said BND historian Bodo Hechelhammer.
Rauff died in Chile in 1984, having evaded trial for war crimes.
The charges related to his time as an official of the criminal technical institute of the Reich security main office, which he joined in 1941.
As US intelligence later put it, Rauff designed gas vans used to murder Jews and people with disabilities.
With German defeat he fled to Chile and changed his name to Enrico Gomez.
But the BND traced him and recruited him as spy, ostensibly to go to Cuba to spy on leader Fidel Castro.
He was denied entry but still earned more than DM70,000 ($18,000, £11,500) during his time with the service.
Publicly he became a wanted man when his wartime role was brought to light but - even after his arrest by Chilean police in 1962 - he was being supported by the BND.
Mr Hechelhammer disclosed that the agency was paying his legal bills as he fought extradition.
Rauff was freed by Chile's Supreme Court five months later in 1963, on the grounds that his crimes had been committed too long ago.
The government of General Augusto Pinochet, who seized power in Chile a military coup in 1973, resisted all calls for Rauff's extradition to stand trial in West Germany or Israel.
The last request to extradite him was turned down in 1983.
He showed no remorse for his Nazi past, and remained in Chile till his death at the age of 77.
He was buried in the capital Santiago to cries of "Heil Hitler, Heil Rauff".
The historian Bodo Hechelhammer also says that Rauff had secretly come to Germany twice between 1960 and 1962 on a course run by the BND.