He was a character that only the Wild West could invent — part lawman, part myth – with a saloon-keeper moustache and a taste for the cards. Wyatt Earp became a real live gunslinging hero, shooting those cattle rustling cowboys at the OK Corral, and he built his name one boomtown at a time riding out of the dust with a pistol and a past. Then came the day in 1896 when he nearly destroyed everything in a San Francisco boxing ring.

History has made Earp an old west legend, riding shotgun through trouble with Bat Masterson and Doc Holiday. But in life he was the man who botched one of the biggest fights of his time. At the start of the 20th century, most people did not see Earp as a demigod of frontier justice, but rather as a dirty referee who fixed the heavyweight championship, running away before many in the crowd realized what had happened.

“Wyatt Earp got more notoriety around that boxing fight than he ever did with the gunfight,” said Scott Dyke, a Earp researcher.

In a modern world where Hollywood has turned Earp into a gun-toting marshal hunting bad guys, the story of how he came to officiate and then ruin the Tom Sharkey and Bob Fitzsimmons fight on 2 December 1896 is largely forgotten. It is so forgotten, in fact, that one prominent boxing expert had never heard of the bout or Earp’s role when reached by the Guardian.

“I’m a historian. I’m supposed to know these things!” the expert said.

Because Earp’s modern legacy has been formed by movie-makers long after his death, his interest in boxing is lost in romanticized tales of gunsmoke.

But Earp never did much fighting with his pistol; his hands were better weapons.

As a teenager Earp once trained with a boxer named John Shanssey and carried an interest in the sport into his adulthood. Years later, he refereed a fight in which Shanssey was being badly beaten, possibly saving his one-time mentor’s life.

After Tombstone and the OK Corral, Earp drifted to San Diego where he ran saloons and dabbled in real estate. He also refereed a number of fights both with gloves and bare knuckles, Dyke said. By the time Earp moved to San Francisco in 1891 he was well-known in west coast boxing circles.

The Sharkey-Fitzsimmons fight was to settle a three-year question as to the rightful holder of the gloved (Marquess of Queensberry rules) heavyweight title. Boxing was illegal in San Francisco but such trivialities as city law hardly mattered as city officials and police commissioners embraced the bout, Mechanics Pavilion was secured as a venue and more than 10,000 tickets were sold.

Both boxers were notorious characters, known well to sports fans at the time.

Sharkey was born in Ireland but had come to the US in the early 1890s and joined the Navy. In celebration of his nautical past he had a blue star and a battleship tattooed across his chest. Fitzsimmons, nicknamed “Ruby Robert” for his red hair, had travelled with a pet lion named Nero – an animal who met an untimely demise when he was electrocuted while chained to the roof of a Cleveland museum.

Earp wasn’t supposed to oversee the fight but neither side could agree on a referee.

In a story about the Sharkey-Fitzsimmons fight, boxing historian Christopher Shelton wrote that Sharkey’s manager, Danny Lynch, suggested Earp – a close friend – oversee the bout. The Fitzsimmons camp resisted the choice, suspicious of the Earp-Lynch connection, before finally relenting a few hours before the fight. Almost immediately after agreeing to Earp, Fitzsimmons’s people heard rumors that Earp had agreed to fix the fight – with its $10,000 prize – for Sharkey, who was a heavy underdog.

According to Shelton, Fitzsimmons’s manager Martin Julian confronted Earp in the ring then turned to the reporters sitting ringside and announced that Earp had been bribed. This was not the only pre-fight indignity Earp would endure. Right after Earp stepped into the ring a San Francisco police captain noticed the Colt 45 pistol Earp had stashed under his jacket and confiscated it in full view of the spectators.

For seven rounds Fitzsimmons dominated the fight. Then in the eighth, he caught Sharkey with a vicious blow to the stomach. Sharkey toppled forward and fell to the canvas writhing in pain. For several seconds Earp did nothing. Match accounts say Fitzsimmons appeared to celebrate a knockout victory, but then Lynch appeared beside Earp. The two men talked for half a minute before Earp declared that Fitzsimmons had punched Sharkey below the belt – a foul – and that Fitzsimmons was disqualified.

The crowd pelted Earp with boos and taunts. He quickly exited the ring and left the Mechanics Pavilion. But his troubles were only beginning. For weeks, fans and sportswriters who said they had never seen a below belt punch mocked the decision. Fitzsimmons’s attorney, HL Kowalsky, told the San Francisco Call that Earp’s ruling was: “Clear and dirty theft.”

An injunction was placed on the $10,000 winner’s check, and the fight made news all over the US with most of the stories taking a similar tone: Earp was no hero lawman, and he had cheated Fitzsimmons of the heavyweight title.

“They actually took surveys of people at the fight to see if they thought there was a foul,” Dyke said. “But it’s like being in the upper deck in left field at a baseball game. You say: ‘I know that pitch caught the corner’ even if way up there you can’t even see the plate.” The injunction hearing was held in an Oakland court. For several days, the details of an alleged fix spilled out. Witnesses testified that gamblers had been saying Earp had rigged the fight for $2,500 of the $10,000 payout. Earp insisted to the court that he did not. Sharkey testified that Fitzsimmons did indeed land an illegal blow. After days of conflicting stories, with plenty of hearsay and little evidence, the judge dismissed the case, ruling that since holding the fight at all was illegal in San Francisco the court could not consider civil action for a criminal activity.

While the court ruling saved Earp from going on trial for fixing the fight, he was convicted of carrying a concealed handgun into the ring and fined $50. But the cheating allegations followed him for the rest of this life.“It didn’t do him any good,” Dyke said. “I think he smarted from that for quite a while. The papers were rough back then and the cartoons were tough.”

The next year, Earp chased the Klondike gold rush to Alaska where he found success as a saloon owner. It was only after the 1931 release of Wyatt Earp: Frontier Marshal, a largely glowing biography, that Earp’s national reputation changed from that of a cheat to a swaggering Wild West gunman. Not that it did Earp much good. He had been dead two years.

When asked if he believes Earp fixed the Sharkey-Fitzsimmons bout, Dyke paused. “Let’s see, how do I walk around this,” he said. “He had a colorful past. You’re dealing with someone who when there is smoke there is fire.

Dyke adds that there are several instances in history where Earp showed great honesty. But Earp was also a gambler, a flawed man who often found trouble.

“At that time cheating was bad if you got caught,” Dyke said. “If you weren’t caught it was acceptable.”

Because eventually history forgets.