BEIJING -- Houston Rockets center Yao Ming and Coca-Cola's China subsidiary have agreed to an out-of-court settlement over his contention that the soft-drink giant used his image without his permission, the company and the government's official news outlet reported Friday.

Coca-Cola said it had apologized to Yao.

The Xinhua News Agency said the agreement withdrawing the legal action from Shanghai's Xuhui District Court was reached Thursday, more than three months after Coca-Cola (China) Beverages Ltd. stopped using Yao's picture on its products.

"This matter is over. We have to move on," Xinhua's Chinese-language service quoted Yao as saying. Yao has a sponsorship agreement with Pepsi-Cola.

Coca-Cola released a statement saying it had reached a "mediation agreement." The company cited its sponsorship of China's national team -- of which Yao is a member -- but acknowledged it was wrong.

"On the basis of the fact that Coca-Cola (China) Beverages Ltd did not seek Yao Ming's consent in advance of its use of Yao Ming's portrait and name on the packaging of its products, Coca-Cola (China) Beverages Ltd. apologizes to Yao Ming for such conduct," the company said.

It said the mediation statement was printed in Chinese media as part of the agreement. Calls by The Associated Press to Coca-Cola offices in China went unanswered Friday night.

Coke said it had stopped producing and selling products bearing the pictures of Yao and two fellow national team members -- Mengke Bateer, then of the San Antonio Spurs and now of the Toronto Raptors, and Chinese player Guo Shiqiang.

Coca-Cola's China operation had earlier maintained it had the right to show groups of at least three members of the Chinese national team under its sponsorship agreement.

Because of the settlement, a trial previously set for Monday has been canceled.

"I hope more commercial sponsors will help Chinese basketball develop," he said in his statement, according to Xinhua.

The commemorative bottles in question, sold earlier this year, showed Yao, Bateer and Guo in Chinese national team uniforms. Yao and Bateer played for China last year in the Asian Games and this year in the Asian men's basketball championship.

This story is from ESPN.com's automated news wire. Wire index