SHANGHAI (Reuters) - China’s highest court has ruled in favor of former basketball star Michael Jordan in a long-running trademark case relating to a local sportswear firm using the Chinese version of his name, overturning earlier rulings against the athlete.

The ruling is a rare bit of good news for a foreign brand in China, where companies, including iPhone maker Apple Inc and shoe brand New Balance, have often come out on the losing side in trademark disputes.

The former Chicago Bulls player sued Qiaodan Sports in 2012, saying the company located in southern Fujian province had built its business around his Chinese name and famous jersey number “23” without his permission.

In 2015 a court ruled in favor of Qiaodan Sports over the trademark dispute, a ruling which was then upheld by the Beijing Municipal High People’s Court. After that ruling Jordan’s legal team said they would take the case to China’s top court.

The Chinese characters for Jordan’s name read as “Qiaodan” in basketball-mad China, which also has a homegrown superstar in former Houston Rockets player Yao Ming.

On Thursday, China’s Supreme People’s Court overturned earlier rulings in favor of Qiaodan Sports using the characters for Jordan’s Chinese name, although it upheld a ruling allowing the firm to use the Romanized version “Qiaodan”.

It added the Chinese firm’s actions had displayed “malicious intent” by registering trademarks for Jordan’s Chinese name.

“I am happy that the Supreme People’s Court has recognized the right to protect my name through its ruling in the trademark cases,” Jordan said in a statement sent to Reuters.

“Chinese consumers deserve to know that Qiaodan Sports and its products have no connection to me.”

The Chinese firm said in a statement on its verified microblog that it respected the court’s judgment and would, according to law, carry out proper protection on the firm’s products and their intellectual property rights.

Reuters could not immediately reach the company for further comment.

Jordan, who has a net worth of $1.24 billion according to Forbes, is the majority owner of the Charlotte Hornets basketball team and has a lucrative endorsement contract with Nike Inc, which makes Air Jordan shoes.

A separate naming rights case is still to be heard.