Score one for the Canadian pirate, at least for now.

A U.S. Federal Court judge has tossed out a complaint against Vancouver grocer Pirate Joe's for reselling goods bought at California-based grocery chain Trader Joe's.

The upscale chain, which has almost 400 stores in 30 U.S. states but none in Canada, alleged Pirate Joe's store owner Michael Hallatt was using deceptive business practices, infringing on its trademark and cutting into its business from Canadian cross-border shoppers.

But in a ruling released this week, U.S. District Court Judge Marsha Pechman dismissed Trader Joe's suit against the tiny Canadian upstart.

Pechman accepted the contention of Hallatt's lawyer that the court lacks jurisdiction to sanction his business because it is located in Canada and Trader Joe's has no operation there to damage.

The U.S. Lanham Act gives the Federal Court jurisdictional power to intervene in extraterritorial disputes, Pechman said, but the facts here simply don't support doing so.

"Here, all alleged infringement takes place in Canada and Trader Joe’s cannot show economic harm," the judge wrote. "Even if Canadian consumers are confused and believe they are shopping at Trader Joe’s or an approved affiliate when shopping at Pirate Joe’s, there is no economic harm to Trader Joe’s because the products were purchased at Trader Joe’s at retail price."

[ Related: Vancouver retailer stands his ground against U.S. grocery giant Trader Joe's ]

Hallatt used to make regular buying forays to Trader Joe's Bellingham, Wash., store himself, spending up to $25,000 a month. He trucked the goods, bought at full retail price, into British Columbia, paying required duties and taxes, then sold them at a markup in his 600-square-foot Vancouver store, NBC News reported.

Staff at the Bellingham store at first looked on Hallatt's business benignly but that changed as his sales grew. Eventually, he found himself barred from the store, as well as other Trader Joe's outlets in the Pacific Northwest.

Stealth buying became a game. He even tried cross-dressing once, buying a muumuu, purse and flip-flops at a thrift store, but aborted the attempt after Bellingham police asked him what he was doing as he dressed in his van and painted his toenails, NBC News said.

"One said, 'You don't even look like a woman,'" Hallatt said. "I took the stuff off. I'd been spared the ultimate humiliation."

Instead, Hallatt now pays 20 "couch surfers and students" to mount cross-border raids to Trader Joe's outlets for a booty of canned goods, pasta sauce, salad dressings, cerals and other non-perishable items Canadian customers want.

Hallatt claims the business isn't particularly profitable but "I've never had more fun making less money in my life."

The court ruling also rejected Trader Joe's claims that the Canadian store could be mistaken for one of its outlets, dismissing the trademark infringement and false-advertising allegations. The company apparently applied to register its trademark in Canada in 2010 but it has not yet been approved, NBC News reported.

Hallatt has said he makes it clear Pirate Joe's, redubbed "Irate Joe's" after the lawsuit was filed earlier this year, has no affiliation with the American chain.

Trader Joe's spokeswoman Alison Mochizuki said the company was disappointed by the ruling.

"We sell our products in our stores to our customers, and to maintain the goodwill and integrity of the Trader Joe's brand it is extremely important to us to protect and preserve the customer experience we have developed in our stores over the past 46 years," she said in a statement, according to The Canadian Press.

[ Related video: Pirate Joe's: Food Chain Fights Bootlegger Smuggling Products Across Border ]

While Pechman dismissed claims under the federal Landham Act with prejudice, meaning they can't be refiled, she gave Trader Joe's 10 days to amend its complaint to consider potential coverage under state laws.

Hallatt told CP he's optimistic he can beat back that challenge as well but said he'd be just as happy if they set up shop in Canada. After all, he opened Pirate Joe's because he liked their products.

"We'd prefer it if they just opened in Vancouver, put everybody out of their misery," Hallatt said. "But you know, in the meantime, I'm here to supply Vancouverites with products that they're asking me to bring in."

Meanwhile, he's handing out free Trader Joe's chocolate bars to celebrate his victory, he told NBC News.

"Woohoo! or perhaps, 'Arr!'" he said.