A New Jersey judge ordered the return of $1.5 million to a casino from gamblers who won at a table game after realizing the cards had not been shuffled.

State Superior Court Judge Donna Taylor ruled in favor of the Golden Nugget casino in its dispute with 14 gamblers who say it was not there fault the cards were not shuffled and should be allowed to keep their winnings.

A mini-baccarat game is where the trouble started in April 2012. The casino was using decks of cards that paid a manufacturer to pre-shuffle, but the deck at hand was not shuffled. Once the gamblers realized the cards were not shuffled, they increased their bets from $10 to $5,000 and proceeded to win 41 straight hands.

Judge Taylor said the games were illegal under state law because they did not conform to the state's gambling regulations.

"The dealer did not pre-shuffle the cards immediately prior to the commencement of play, and the cards were not pre-shuffled in accordance with any regulation," the judge wrote. "Thus, a literal reading of the regulations ... entails that the game violated the (Casino Control) Act, and consequently was not authorized."

The Golden Nugget casino bought what were supposed to be pre-shuffled cards from a Kansas City Manufacturer. The manufacturer did acknowledge it failed to shuffle the cards. The litigation between the manufacturer and the casino was resolved, but a confidentiality agreement prevents details from being revealed.

The Associated Press contributed to this report