The gambler eyed the cards being laid out on the baize table and murmured quietly to his attractive Asian companion. She had accompanied him, he told the staff at the London casino, purely for 'good luck'.

But why then was she the one talking to their female dealer in Mandarin Chinese, persuading her to oblige her friend's extreme superstitiousness with all manner of harmless little changes to the high stakes game of baccarat he was playing.

Some might have been suspicious, but casinos love the so-called 'high-rollers' willing to gamble millions in a single session. And they didn't come much more high-rolling than Phil Ivey, regarded as the world's greatest poker player.

Scroll down for video

A Mayfair casino will not have to pay poker player Phil Ivey (left) £7.7million in winnings after a High Court judge ruled the 'edge-sorting' technique he used, helped by Cheung Yin Sun (right), was cheating

His arrival at Crockfords in Mayfair, Britain's oldest casino, the previous night had caused genuine excitement, not to mention a gleeful rubbing of hands.

As a casino inspector paced the private room, hung not only with chandeliers and oil paintings but also a battery of security cameras, the scene one August night two years ago could have come straight from the pages of Ian Fleming.

Especially when the couple coolly walked out at the end of two nights of gambling that had seen a staggering £106 million won and lost at various times. In the end, they had made £7.7 million at James Bond's favourite card game.

Their achievement was all the more impressive because Punto Banco, the version they were playing, involves no skill whatsoever.

His arrival at Crockfords in Mayfair, Britain's oldest casino, the previous night had caused genuine excitement, not to mention a gleeful rubbing of hands

This week, the same pair were back in Central London, this time in the High Court, for an equally high stakes game as Ivey, an American, tried to convince a judge he had not been cheating and the casino had no right to withhold his winnings.

Indeed, Ivey felt so confident in his case — the biggest legal battle in British casino history — that the American stunned the gambling world by admitting precisely how he did it. And the truth was even more ingenious — Crockfords might prefer the word 'devious' — than anything James Bond ever faced.

For Ivey, 38, and his companion — no casual observer but one of the sharpest operators in Las Vegas — were 'edge sorting'. That means he and Cheung Yin Sun were able to 'read' the cards by spotting imperfections on the back of them.

Crockfords and its owners, the £21 billion Genting Group of Malaysia, were not prepared for this when Ivey came to play.

He was 16 when he told his parents in New Jersey he was going to become a professional gambler. He developed his poker skills playing colleagues at a telemarketing firm, went on to win countless World Series 'bracelets', or championships, and is regarded as the best all-round player on the planet.

He now lives in Las Vegas, after divorcing his wife, and his life is dedicated to the game. So when he contacted Crockfords and told them he would like to come to London and lay seven-figure bets on its tables, the casino was keen to accommodate him.

High-rollers can make a huge difference to a casino's balance sheet. However much he won or lost, it would be good for the casino's image to have the 'Tiger Woods of Poker' on the premises.

Ivey was 16 when he told his parents in New Jersey he was going to become a professional gambler

He asked to play in a private room with a 'Mandarin-speaking dealer because Ms Sun doesn't speak good English'. Crockfords was also happy to allow a range of other unusual requests. Baccarat players are notoriously superstitious as the game is purely down to chance

He wanted to wear his 'lucky hat' and to be able to choose a 'lucky' pack of cards — he specified the Angel brand made by the U.S. company Gemaco — that the casino would then use for the entire time he was playing there.

This pack had to be dealt and shuffled in a 'lucky' way.

The idea of Punto Banco is to bet on which hand of cards — the player's or the dealer's — adds up closest to nine. Players first place their bets, then the cards are dealt face-up. Each hand contains a minimum of two cards and a maximum of three. Tens, jacks, queens and kings are all valued at zero — so sevens, eights and nines are the most important cards in the game.

To begin with, the game was going Crockfords' way. During several hours of play Ivey made repeated requests for decks of cards to be changed. This continued until he found that 'lucky' pack he wanted.

But it wasn't luck. Ms Sun had finally spotted the deck of playing cards she had been looking for.

Angel brand cards have a purple-coloured diamond pattern on the back. An expert at 'edge-sorting', Ms Sun knew some of these packs have a tiny — but crucial — flaw.

The geometrical pattern on the backs of cards is supposed to be symmetrical, but on these it wasn't. Looked at very closely, the pattern along the long edge on one side of each card is noticeably different from the long edge on the other.

What the pair of gamblers managed to do next was crucial. Ms Sun asked the dealer to rotate the 'strong' cards — the sevens, eights and nines — by 180 degrees 'for luck' before they were put back into the pack.

This transferred the pattern flaw to the opposite side of the card — from the left side to the right — which meant all the 'strong' cards had the flaw on the same side of the card, and it was a different side from that of all the other cards.

Armed with this information, Ms Sun and Mr Ivey could tell whether the dealer was about to deal a 'strong' card as the first card in each hand. All they had to do was study the back of the top card waiting in the card 'shoe', or dispenser, used by the dealer and Ivey would place his bet accordingly before the game began.

In this way, Ivey turned the game from the dealer's advantage to his advantage — and raised the stakes.

Betting as much as £150,000 a hand, he and his companion gradually started winning and winning.

But unless anyone was aware they were carefully studying the backs of the cards rather than the front, they would have been at a loss to explain what had happened as anything other than a tremendous streak of good fortune.

When the pair finally got up to leave, they were told it was a bank holiday the following day. Given they would have flown back to the U.S. by the time banks were open again, the money would be wired to Ivey, said Crockfords.

However, the casino clearly realised something was fishy because it never sent him the money and returned only his £1 million stake money.

The argument rumbled on until, in May last year Ivey announced he would be taking legal action, saying: 'I am deeply saddened Crockfords has left me no alternative. Over the years I have won and lost substantial sums at Crockfords and I have always honoured my commitments. At the time, I was given a receipt for my winnings but Crockfords subsequently withheld payment.'

For its part, Crockfords clearly felt that Ivey had not won the money fair and square. So should the casino staff have realised far earlier than they did that Ivey's winnings were about something more than luck?

Edge-sorting is just one weapon in the arsenal of so-called 'advantage players' — who try to find legal ways of improving their odds of winning. But Ms Sun has already been banned from at least one U.S. casino for doing it there.

Ivey said he sees it as the professional gambler's job to 'exploit the weaknesses' of casinos, and try to even out the odds casinos always ensure are stacked in their favour.

Edge-sorting, Ivey insisted in court, involves nothing more than using information available to any player simply from viewing the backs of the cards the casino chooses to use, and by making requests of the house which it is entitled to refuse.

Crockfords, in other words, should have known better.

Sadly for Ivey and 'advantage players' everywhere, Mr Justice Mitting, begged to differ. The judge, who admitted he has never been in a casino and sticks to bridge, commended the American on his truthfulness but ruled his actions amounted to 'cheating for the purposes of civil law'.

Ivey will not get his winnings and will have to pay costs. Worse, the verdict won't help him in another pending legal suit, this time in the U.S. The Borgata casino in Atlantic City is demanding back $9.6 million that it says Ivey won from it in the same circumstances.

Phil Ivey is estimated to have won $100 million from poker — entirely legitimately — and says he is most upset about being labelled a 'cheat'. Such a reputation is 'death' in his world, he told the High Court.

But professional gamblers across the world made clear yesterday they believe he was hard done by and that anyone who tries to level the odds against an unscrupulous casino industry deserves praise.

Even Hollywood star Ben Affleck, another keen 'advantage player', railed against casinos this month after a Las Vegas casino banned him for 'card-counting', in which players mentally keep a record of cards that have been played so they have a good idea of what cards will appear next.

One feels sure 007 would never have stooped so low as counting cards or edge-sorting. Indeed, in the novel Moonraker, his boss M asks him to come to his club, Blades, and work out how the evil millionaire Drax is cheating at cards. Sure enough, he cracks it before the evening is out.