An antique typewriter sold at a Romanian flea market for $114 turned out to be a rare piece of wartime history: a German Wehrmacht Enigma I machine worth tens of thousands of dollars, Reuters reports.

To the uninitiated, the rare electromechanical cipher machine—which was first developed in Germany in the 1920s, and was used to encode and decode Nazi military messages during World War II—resembles a writing machine. But when a cryptography professor spotted it, he knew the device’s true worth. He purchased the relic and later put it up for auction at the Bucharest auction house Artmark.

Artmark employee Vlad Georgescu told CNN that the machine was made in Germany in 1941. It was in near-perfect condition thanks to its owner, who cleaned and repaired it, and “took great care of it,” Georgescu said.

The Enigma I’s starting price was $10,300. On Tuesday, July 11, an online bidder purchased it for more than $51,000. "These machines are very rare, especially entirely functional ones," Georgescu said. Historians, however, say that Romania may still be home to more unidentified Engima I machines, as the country was once allied with Nazi Germany before joining forces with the Allies in 1944.

During World War II, Alan Turing and his colleagues at Bletchley Park, Britain's central codebreaking site, built a giant computer called the Bombe to calculate solutions that solved the Enigma’s supposedly unbreakable code. Some military historians believe that their efforts shortened the war by at least two years.

[h/t BBC News]