In addition to N.F.L. players and Mr. Ball, Mr. Trump has in the past tweeted angrily at other African-American athletes and broadcasters, including Stephen Curry, the star basketball player for the Golden State Warriors, and Jemele Hill, a sports journalist who is a host of ESPN’s flagship “SportsCenter.”

In the case of the N.F.L. players, Mr. Trump has played to the beliefs of his most conservative supporters by openly deriding Colin Kaepernick, the former San Francisco 49ers quarterback who last season kicked off the idea of sideline protests by kneeling.

Speaking to an adoring, and mostly white, crowd in Huntsville, Ala., in September, Mr. Trump referenced the actions of football players like Mr. Kaepernick who knelt during the national anthem and said he would love to see an N.F.L. owner say, “Get that son of a bitch off the field right now.”

On Wednesday, the president kicked off the first day of a five-day visit to his Mar-a-Lago club in Palm Beach, Fla., by focusing his ire on Mr. Ball, the outspoken father of the U.C.L.A. basketball player LiAngelo Ball, who, along with his teammates Cody Riley and Jalen Hill, was released from Chinese custody after Mr. Trump intervened.

Mr. Ball stoked the confrontation with the president this week, refusing on CNN to thank Mr. Trump for his assistance and saying that “I don’t have to say, to go around saying thank you to everybody.”

That interview appears to have prompted the angry response from Mr. Trump. He insisted that he was the one who rescued Mr. Ball’s son, and he chided Mr. Ball for refusing to give Mr. Trump the due he felt he deserved.

“LaVar, you could have spent the next 5 to 10 years during Thanksgiving with your son in China, but no NBA contract to support you,” Mr. Trump wrote, referring to another of Mr. Ball’s sons, who plays professional basketball. “But remember LaVar, shoplifting is NOT a little thing. It’s a really big deal, especially in China. Ungrateful fool!”