A U.S. appeals court said on Friday that Tesla Inc CEO Elon Musk violated federal labour law by tweeting that employees of the electric vehicle maker would lose stock options if they joined a union.

The New Orleans-based 5th U.S. Circuit Court of Appeals upheld a decision by the U.S. National Labor Relations Board that said the 2018 tweet amounted to an unlawful threat that could discourage unionising and ordered Musk to delete it.

Amid an organising campaign at Tesla's Fremont, California, plant by the United Auto Workers (UAW) union, Musk tweeted: "Nothing stopping Tesla team at our car plant from voting union ... But why pay union dues & give up stock options for nothing?"

Tesla did not immediately respond to a request for comment.

Legal trouble

UAW President Shawn Fain applauded the decision in a statement but said it also highlights "our broken US labor law."

"Here is a company that clearly broke the law and yet it is several years down the road before these workers have achieved a modicum of justice,” Fain said.

Also read: Elon Musk lists exclusive features for verified accounts on Twitter

Musk's prolific use of Twitter has landed him in legal trouble before. Tesla in February defeated a lawsuit from investors over another Musk tweet from 2018 saying funding was secured to take the company private, and a British cave explorer unsuccessfully sued Musk for calling him a "pedo guy" on Twitter.

Musk purchased Twitter last year for $44 billion.

Panel disagrees

In Friday's case, Tesla had argued that the tweet about unionising was not a threat and merely reflected the fact that union workers at other auto companies did not receive stock options.

But a three-judge panel of the 5th Circuit disagreed.

"Substantial evidence supports the NLRB’s conclusion that the tweet is an implied threat to end stock options as retaliation for unionization," the 5th Circuit panel wrote.

The labour board in a separate case last year said Tesla violated labour law by prohibiting workers at the Fremont plant from wearing shirts supporting the union campaign. The company is appealing that decision.