In early 1826, one of Europe’s most celebrated chess masters arrived in New York for his American debut. The event was widely touted in news articles and advertisements, and some 200 people later turned out for the first exhibition matches at Broadway’s National Hotel. To their great delight, the chess master proceeded to trounce any audience member that dared challenge him. “Two accomplished chess players played jointly against him,” the Commercial Advertiser wrote, “but were beaten with great ease.” Before long, accounts of the mysterious chess master were filling the pages of all the major newspapers in New York. Match crowds grew so large that hundreds had to be turned away at the door. The response would’ve been unusual, if not for one key fact: the chess player wasn’t human. It was an automaton—a mechanical robot that seemed capable of reasoning its way through one of the world’s most intellectually demanding board games.

The chess automaton had passed through different owners over the previous decades, but it had always taken the form of a life-sized dummy seated behind a large wooden cabinet. The cabinet’s interior was crammed with a series of gears, cranks and levers that resembled the innards of a clock. As for the dummy, it wore a turban, carried a pipe in one hand and was swathed in colorful robes. It was from this costume that the automaton got its name: the Turk.

The Turk had first appeared in 1769 in the court of Maria Theresa, the empress of Austria-Hungary. In a bid to impress the empress, an inventor and royal advisor named Wolfgang von Kempelen had vowed to build an automaton whose illusion and spectacle would surpass anything she had seen before. Intrigued, Maria Theresa granted him a leave of absence to work on his mystery project.

Kempelen resurfaced just six months later with the machine that would become known as the Turk. Its first performance took place in 1770 in front of Maria Theresa and a group of nobles, all of whom watched as Kempelen wheeled out his automaton chess player and its four-foot cabinet. In an act that would be repeated countless times over the years, the inventor began the show by unlocking the cabinet doors one at a time to display the machine’s interior clockwork. He even used a candle to illuminate the inside of the mechanism so the audience could see there was nothing hidden inside. After soliciting the automaton’s first opponent from the audience, Kempelen walked to the side of the cabinet and wound up a crank. Suddenly, the dummy came to life and slowly turned its mechanical head from one side to the other. It then reached across the board, grasped a pawn and made the game’s first move.

The Turk beat all comers during its first exhibition, and it soon became something of a sensation in court. Audiences simply didn’t know what to make of it. Some speculated that the automaton was somehow controlled by magnetism, while others argued that it was designed so that a dwarf or a child operator could hide inside. For every doubter, however, there were just as many others who considered it a technological marvel. As one observer wrote of Kempelen, “it seems impossible to attain a more perfect knowledge of mechanics than this gentleman has done.”

Kempelen retired the Turk in 1774, but interest was later revived during the reign of Maria Theresa’s successor, Joseph II. In 1783, on Joseph’s orders, Kempelen took the automaton on a two-year tour of Europe. At its first stop in Paris, the machine matched wits against some of the world’s top chess masters. It even beat Benjamin Franklin, who was then serving as the American ambassador to France. From there, the Turk continued its travels across England, Germany and the Netherlands. At each stop, it defeated most of its opponents and befuddled all the men of science who tried to explain it.

Kempelen died in 1804, but the Turk was later purchased by a German inventor and showman named Johann Maelzel, who toured with it for the rest of his life. Maelzel added a bit of flair to his exhibitions by installing a mechanical voice box that allowed the automaton to say “check!” whenever it endangered an opponent’s king. He also started promoting its performances with advertisements and newspaper articles. Maelzel’s biggest coup came in Vienna in 1809, when he arranged a match between the Turk and Napoleon Bonaparte. The French emperor reportedly attempted a few illegal moves during the game—which he lost—but each time, his mechanical adversary would simply shake its head and place the piece back where it had been.

It was Maelzel who later brought the Turk to the United States in 1826. After dazzling audiences in New York, he took it to Boston and Philadelphia before embarking on an extended tour of the South. In Richmond, Virginia, one of the Turk’s performances was witnessed by a young Edgar Allan Poe, who later wrote an essay arguing that the machine was a sham orchestrated by a hidden human operator. “It is quite certain,” he wrote, “that the operations of the automaton are regulated by mind, and by nothing else.”

Poe certainly wasn’t the first person to argue that the Turk was a fraud. Since its original appearance in the 1780s, skeptics had written several pamphlets and exposés that sought to debunk the claim that the machine was capable of playing chess on its own. Some, such as Poe and the British writer Robert Willis, maintained that a chess master hid inside the cabinet and controlled the game by wriggling into the Turk’s mannequin body.

While the critics were right about the Turk being controlled by a human operator, none of them ever managed to fully explain how the hoax worked. In actuality, the machine’s cogs and cranks were all non-functioning decoys that only extended only part of the way through the cabinet. This left a small space into which a human chess master could wedge himself. As Kempelen or Maelzel opened all the cabinet doors to exhibit the interior parts to the audience, the operator used a mechanical sliding seat to move out of view. Afterward, he would settle into an open space in the main compartment, light a candle and follow the progress of the game outside by watching a series of dangling metal discs, which were attracted to magnets in the base of the chess pieces. To make his own moves, the operator used a series of levers that could move the Turk’s arm and open and close its fingers.

Finding a person skilled enough to conduct all of these mechanical operations was certainly no easy task, but the even bigger problem was getting an operator who was an expert at chess. Kempelen and Maelzel both relied on skilled players whom they either enlisted during their travels or brought with them as phony members of their entourage. During the Turk’s American tour, Maelzel used a European chess master named William Schlumberger, who posed as his personal secretary whenever he wasn’t concealed inside the cabinet.

The Turk held its secrets tight for over 65 years, but the ruse finally started to unravel in 1838, when Maelzel died during an ocean voyage from Cuba to the United States. His chess automaton fell into the hands of one of his creditors, who eventually sold it to a syndicate of enthusiasts who were interested in unlocking the truth about its operation. Led by a doctor named John Kearsley Mitchell, the group eventually spent several months exhibiting the automaton in Philadelphia before donating it to the city’s Chinese Museum.

The Turk had met kings and queens and fooled thousands of people during its illustrious career, but once consigned to the Chinese Museum, it was largely forgotten. It lay dormant until the night of July 5, 1854, when the museum caught fire. Dr. Mitchell’s son, Silas, rushed to the site, yet by the time he arrived, the flames had already consumed the 85-year-old chess player. Silas Mitchell would go on to pen the first tell-all article exposing the Turk’s secrets. In it, he wrote that as the automaton burned, he imagined he could hear its voice box saying “check!” over the sound of the blaze.