A handwritten notebook by Alan Turing, containing writing on mathematics and computer theory, has sold for $1m at Bonhams.
The lot, which dates to 1942, led an auction of rare books and manuscripts in New York on April 14.
Cassandra Hatton of Bonhams explained the contents of the notebook to the Financial Times in the run-up to the sale: "He is working on logic and the foundations of mathematics with the aim of creating a universal language for a universal computing machine.
"To be able to look in and see his thought processes is extremely important ��� you see the types of things in mathematics that really bothered him, what he thought needed to be worked on."
Turing was a key member of the British team at Bletchley Park that cracked the German Enigma code - a feat that is claimed to have reduced the length of the second world war by around two years.
Despite his monumental contribution to the war effort, he was hounded by the British government over his homosexuality. He was found dead from cyanide poisoning in 1954, after undergoing rounds of chemical castration.
After Turing's death, the notebook passed into the possession of Robin Gandy - a fellow mathematician and close friend.
Intriguingly Gandy, who was also gay, wrote a series of discourses on his own sexuality in the margins.
He writes: "It seems a suitable disguise to write in between these notes of Alan's, but possibly a little sinister; a dead father figure, some of whose thoughts I most completely inherited."
Hatton commented: "This is a wonderful result and a fitting testament to Alan Turing's impact and legacy.
"It has been a great privilege to have been involved in this sale and we are immensely pleased that all the people who bid for this unique item and indeed the wider public have recognized Turing's importance and place in history."
A record was set for an Enigma machine, after a rare specimen from 1944 sold for $269,000. This is an increase of 29.2% on the previous auction record, set for a comparable specimen at Christie's in 2011.
Please sign up to our free newsletter to receive exciting news about memorabilia auctions.