It's a good thing Lionel Messi's rich -- 'cause the soccer superstar was gambling away some of his cash ... hours before he was ordered to fork over roughly $2 MILLION in a tax fraud case.
TMZ Sports obtained pics and spoke with witnesses who saw Messi hitting the roulette table and playing some blackjack at the Atlantis Resort in the Bahamas.
Before he hit the casino floor, Messi was spotted at dinner at the resort with a man who appears to be his father.