US laws prohibiting cross-border gambling break trade rules, the World Trade Organization says.
Could the chips be down for US authorities?
The WTO case was brought by the Caribbean state of Antigua and Barbuda, host to many of the online casinos whose use is illegal in the US.
The ruling confirms a preliminary judgement issued in March.
But the US said it will appeal and - as a last resort - could activate its right to change the deal under which it joined the WTO in the first place.
"This panel report is deeply flawed," said a spokesman for US Trade Representative Robert Zoellick.
An appellate panel will now consider the appeal over the next few months.
'David and Goliath'
The ruling, written by a three-person panel, says the US law effectively breaches a 1994 global deal which liberalises trade in services.
Antigua and Barbuda, whose population is just 67,000, says it gets as many as 3,000 jobs from internet gambling.
The business has helped it weather the downturn in tourism.
The US law - which forbids paying for betting by means of US-issued credit cards or cheques - is endangering its economy, it said.
In a statement, the islands' government said it had won a "David and Goliath" fight, and insisted it had tried to reach a negotiated settlement only to be rebuffed five times.
It also quoted a survey suggesting the US was home to half the worldwide online gambling market.
'Shocking and troubling'
But the US says the ban, based on a 1961 federal law originally designed to cover telephone bets, is designed to protect against both money laundering and the exposure of vulnerable sections of society to gambling.
One often-cited example is stopping children from running up gambling bills on their parents' credit cards.
The WTO panel had turned down a request by the US to use a "public morals clause" in WTO rules to keep the ban, one trade official told Reuters.
The rebuff was "shocking and troubling", he said.
Antigua and Barbuda, however, represent just a small part of the world's online gaming.
The Government Accountability Office, until recently known as the General Accounting Office, has estimated that there are more than 1,800 internet gambling operations.