Koestler made three trips to Spain during the civil war; the third time he was captured, sentenced to death and imprisoned by the Nationalist forces of General Franco.
Spanish Testament is (and shall remain) out of print; Dialogue with Death has been reissued in England under that title, in the form in which it was originally written.
He had only narrowly escaped arrest by Franco's army on his previous sojourn into Nationalist territory, when on his second day in Nationalist-held Seville he was recognised by a former colleague of his from Ullstein's in Berlin, who knew that Koestler was a Communist.
The episode is recorded in detail in the memoirs of Sir Peter Chalmers Mitchell, a 72 year old retired zoologist (and the driving force behind the creation of Whipsnade Zoo) who was providing Koestler with safe haven at the time and who was also arrested.
The contradiction between relatively humane daily treatment and the constant threat of summary execution forms a central theme of the book.
Koestler quotes a message he got from three other prisoners, Republican militiamen: "Dear comrade foreigner, we three are also condemned to death, and they will shoot us tonight or tomorrow.
Koestler considered his book, written after he was released and returned to Britain, to be the testament of the three men and his other fellow prisoners who did not survive.
Koestler's prison experience contributed to his acute psychological insight in his portrayal of events in Darkness at Noon (1941), an anti-Communist novel which became a best-seller and gained him international attention.