(CNN)A rare Enigma machine used by Nazi Germany during World War II was sold at auction Tuesday for 45,000 euros ($51,500).
The collector who put the machine up for sale at the Artmark auction house in Bucharest, Romania, had spotted it at a flea market in the city and bought it for just 100 euros ($114).
Vitally important to Nazi war efforts, the Enigma machine was used by the German military to encrypt messages into a form they believed was unbreakable.
But the code was cracked by a team of cryptologists at Bletchley Park in southern England -- a breakthrough widely credited with having shortened the war by at least two years.
The instrument sold Tuesday -- to an unnamed online bidder -- was made in Germany in 1941 and is in almost perfect condition, Vlad Georgescu, relationship manager at Artmark, told CNN.
"It belonged to a mathematician who has spent most of his life decrypting codes," he said. When he saw it for sale at the flea market, he immediately realized what it was and was "compelled to purchase it," he explained.
According to Georgescu, the previous owner simply did not realize the significance of the item -- he thought it was just a normal typewriter.