The three UCLA men's basketball players who were detained in China after they were arrested on shoplifting charges in Hangzhou last week left China for the U.S. late Tuesday after President Trump raised the matter with Chinese President Xi Jinping.

The basketball players, LiAngelo Ball, Jalen Hill, and Cody Riley, all freshmen, were seen at the airport in Shanghai late Tuesday, according to the Wall Street Journal. The three were checking into a Delta Air Lines flight to Los Angeles, airline staff said.

The basketball players also checked out of their hotel in Hangzhou, ABC News reported. They had been staying there since they were released on bail last Wednesday. The rest of the UCLA men's basketball team had already returned to the U.S.

Pac-12 Commissioner Larry Scott confirmed in a statement the UCLA basketball players were on a flight bound for Los Angeles and said the "matter has been resolved to the satisfaction of the Chinese authorities."

"We are grateful for the role that our Chinese hosts played, and for the courtesy and professionalism of the local authorities," Scott said. "We also want to acknowledge UCLA’s significant efforts on behalf of their student-athletes. Finally, we want to thank the President, the White House and the U.S. State Department for their efforts towards resolution."

Ball, Hill and Riley were arrested last week for allegedly stealing sunglasses from a Louis Vuitton store near their hotel in Hangzhou. The team was in China for its season opener against Georgia Tech on Saturday.

Trump told reporters aboard Air Force One on Tuesday he spoke about their arrests with Xi.

“The basketball players, by the way — I know a lot of people are asking — I will tell you, when I heard about it two days ago, I had a great conversation with President Xi. What they did was unfortunate,” he said. “You know, you’re talking about very long prison sentences. They do not play games.”

Trump said Xi was “terrific” in discussing their arrests, and said “they’re working on it right now.”

“But it’s a very, very rough situation with what happened to them,” the president said. “President Xi has been terrific on that subject, but that was not a good subject. That was not something that should have happened.”