SAN ANTONIO (AP) — R.J. Barrett made a career-high seven 3-pointers and scored 32 points, and the New York Knicks snapped a three-game skid, beating the San Antonio Spurs 121-109 on Tuesday night.

“Things may not be going well and, all of a sudden, you take a charge, get to a loose ball, you get a tip from behind, you get a block,” Knicks coach Tom Thibodeau said. “That could ignite you and all of a sudden you get an easy score, a couple of easy buckets and now you find your rhythm and things change quickly in this league. They can go from being terrible to being great real fast and vice versa. You’ve just got to keep going.”

Alec Burks scored 18 points, Immanuel Quickley added 16 points and Julius Randle had 15 for the Knicks, who won at San Antonio for the first time since Jan. 2, 2014.

“Heck yeah, we needed that,” New York center Mitchell Robinson said. “We needed that win bad. We’re desperate right now.”

Derrick White had a season-high 26 points along with six rebounds and seven assists for the Spurs, who have dropped two straight after a season-long three-game winning streak. Dejounte Murray added 15 points, seven rebounds and seven assists.

“That first game, being a back-to-back, after a road trip, we knew that would be tough energy-wise,” San Antonio coach Gregg Popovich said. “But I thought we competed our (butt) off. Guys gave their effort. I was really happy with that.”

The Knicks were 18 for 38 on 3-pointers, with Barrett going 7 for 8.

Barrett said he's feeling “a lot better” after suffering from a stomach bug for two weeks.

“It was annoying, but I tried to do my job to the best of my ability no matter what,” Barrett said.

Barrett, who finished 11 of 20 from the field overall, made two 3s during a 10-2 run that gave New York a 13-point lead midway through the third quarter. The Spurs briefly got within nine points in the fourth but couldn’t trim the lead any further.

“I think the defense was really, really focused on Julius,” Barrett said. “They were doubling on him every time he had the ball and we just moved it. We moved it and I was able to knock them down.”

New York took advantage of the Spurs’ smaller lineups, out-rebounding the Spurs 56-49 and enjoying a 21-8 advantage in second-chance points.

San Antonio got even smaller when starting forward Keldon Johnson exited early in the third quarter with a sprained right ankle. Johnson was injured with 1:21 left in the first half after stepping on Poeltl’s foot. He started the second half but appeared to be in some pain before heading to the locker room.

Popovich said X-rays on Johnson's ankle were negative.

A CHANGE

Thibodeau started Nerlens Noel at center instead of Robinson, who had started all 20 games he had played previously this season.

“We feel really strongly about both guys,” Thibodeau said. “We just wanted a different look. Those guys are interchangeable, just go as hard as you can for as long as you can and then the next guy comes in and does the same thing.”

Robinson had 11 points and 14 rebounds in 22 minutes. Noel had two points and nine rebounds in 26 minutes.

Robinson endured a scare when he injured his back with 56.4 seconds left in the third quarter after an awkward landing. He went flying after his legs were clipped when Spurs center Drew Eubanks dived for a loose ball.

Robinson stayed in the game but said he was in pain afterward. He walked gingerly into and out of the interview room.

“The ground ain’t never lost,” Robinson said.

TIP-INS

Knicks: New York had lost seven straight at San Antonio. Carmelo Anthony and Iman Shumpert each had 27 points to lead the Knicks in their previous win. ... New York is 7-4 on the road but entered having lost three of four away from home.

Spurs: G Devin Vassell missed his third straight game with a bruised right quadriceps. ... The Spurs entered Monday having played the fewest games of any NBA team. That will change quickly as the Spurs play five games in seven days. ... San Antonio is 4-7 at home and has not had a winning record at AT&T Center since winning its season opener.

UP NEXT

Knicks: At Indiana on Wednesday.

Spurs: Host Denver on Thursday.

___

More AP NBA: https://apnews.com/hub/nba and https://twitter.com/AP_Sports