Image copyright Reuters Image caption (L-R) UCLA basketball players Cody Riley, LiAngelo Ball and Jalen Hill

Three US athletes caught shoplifting in China have thanked President Donald Trump for helping free them after he wondered if they would be grateful.

At a news conference, UCLA basketball players LiAngelo Ball, Cody Riley, and Jalen Hill admitted stealing from a shopping centre in Hangzhou.

The trio, who were held on 8 November and flew back to Los Angeles on Tuesday, apologised for their actions.

President Trump had said they were heading for a lengthy prison term.

On Wednesday morning, he tweeted: "Do you think the three UCLA Basketball Players will say thank you President Trump?

"They were headed for 10 years in jail!"

Mr Trump has just returned from a 12-day tour of Japan, South Korea, China, Vietnam and the Philippines.

The first-year students were arrested ahead of a match in Shanghai, accused of thieving expensive sunglasses from a high-end mall.

White House chief of staff John Kelly has detailed how Mr Trump intervened in their case during his own Asian tour.

"Our president said to [Chinese President] Xi, 'Do you know anything about these knuckleheads that got caught allegedly stealing?'" John Kelly told the New York Times.

"The president was saying, 'It's not too serious. We'd love to see this taken care of in an expeditious way.'"

The discussion between the two world leaders occurred on the sidelines of an economic summit in Vietnam on Sunday.

Image copyright Reuters Image caption The players were mobbed by reporters upon their return to LAX airport

The White House chief of staff said China agreed to reduce the charges, leading to their release.

The players looked sheepish at Wednesday's press conference as they apologised to their teammates, coaches, family, university and the people of China.

Mr Riley said: "I take responsibility for the mistake I have made - shoplifting.

"I know that this goes beyond me letting my school down, but I let the entire country down."

He added: "To President Trump and the United States government, thank you for taking the time to intervene on our behalf."

Image copyright Getty Images Image caption LiAngelo Ball was one of the three held in China

Mr Ball said: "I'd like to start off by saying sorry for stealing from the stores in China. I didn't exercise my best judgement."

He added: "I would also like to thank President Trump and the United States government for all the help they provided as well."

Mr Hill said: "I'm sorry for shoplifting. What I did was stupid. There's just no other way to put it, and I'm not that type of person."

"Thank you to the United States government for your efforts to bring us home," he added, without specifically mentioning the president.

"You're welcome," Mr Trump tweeted to the athletes, and he even offered them some advice.

"HAVE A GREAT LIFE!" he tweeted. "Be careful, there are many pitfalls on the long and winding road of life!

Larry Scott, head of the Pacific-12 athletic conference, of which University of California, Los Angeles is a member, said earlier in a statement that the trio had been allowed to leave China after the situation was "resolved to the satisfaction of the Chinese authorities".

"We want to thank the president, the White House and the US State Department for their efforts towards resolution," Mr Scott added.

The three African-American players were confined to their hotel as their team went on to defeat Georgia Tech 63 to 60.

On Twitter, several people complained that Mr Trump has previously been critical of black US athletes.

They cited NFL players who have protested the US national anthem by "taking a knee".

You might also be interested in:

UCLA basketball players 'arrested in China for shoplifting'

NFL protests: From one man kneeling to a movement dividing a country