In the casino, he is used to winning. But in the High Court – where many a fortune has been won and lost – one of the world’s most famous poker professionals learned that he had played a losing hand.

Phil Ivey, 38, a celebrated American gambler dubbed "the Tiger Woods of poker", lost his bid to force a Mayfair casino to pay him £7.7m, that he had won by exploiting a tiny flaw in the cards. Employing a technique known as “edge-sorting” allowed him to guess the value of the next card coming out of the dealing machine, simply by asking the croupier to turn the card around 180 degrees.

He claimed that he had exploited the casino’s failures to take proper security measures and they went along with all his requests without question. “Putting it bluntly, he played, he won and they ought to pay up,” his counsel Richard Spearman had claimed.

The court had heard that he created an “air of superstition” to dupe casino staff about what he and a colleague were doing during a series of marathon sessions in a private room, which ended with him winning £7.7m.

But in his ruling, Mr Justice Mitting said that Mr Ivey used the croupier as an innocent agent and that her superiors had also been unaware about what was going on.

“This is, in my view, cheating for the purpose of civil law,” he said.

Staff at London’s Crockfords Club – part of the £21bn Malaysian Genting Group – had been unaware of the tiny flaw in the back of the cards that allowed Mr Ivey to prosper in the game of Punto Banco, a version of Baccarat, during four sessions in August 2012.

Mr Ivey expressed his disappointment and insisted that his technique was a legitimate strategy despite the judge ruling that he had no right to the money. Mr Ivey said that the casino should have taken better steps to defend themselves against the technique. “Clearly today the judge did not agree,’ he said in a statement.

A Crockfords spokeswoman said: “It is our policy not to discuss our clients’ affairs in public and we very much regret that proceedings were brought against us.