Hope Clarke, 32, was camping at Yellowstone last year when she failed to pack away a bag of marshmallows and was fined for "improper food storage at a national park" under a law to stop people enticing animals with food.
She paid the $50 fine by credit card.
Last Friday, she was returning from Mexico to Miami on the cruise ship Fascination when there was a security check aimed at finding drugs, illegal immigrants and contraband. A check of the passenger list against a federal law enforcement database suggested Ms Clarke had not paid the Yellowstone fine. She was woken at dawn, handcuffed and imprisoned.
On discovering the mix-up, the magistrate overseeing the case ordered her to be released immediately: "The ticket has been paid. This woman should not be in custody."
But the prosecution would not give up, arguing that there might be "some discrepancy" between Ms Clarke's story and the official documents.
The magistrate, John O'Sullivan, intervened again. "Seven hours in jail, I think, is a suitable punishment for leaving marshmallows out at a campsite," he said.