TORONTO (AP) A crucial turnover brought a sour end to DeMar DeRozan's first game back in Toronto.

Kawhi Leonard stole the ball from DeRozan to score the go-ahead dunk with 15 seconds left and the Raptors beat the San Antonio Spurs 120-117 on Friday night, spoiling the former Toronto star's return to Canada.

"Tonight was like a playoff game," Leonard said. "We had to grind it out all the way to the end."

Leonard scored 19 of his 25 points in the second half, and combined with Kyle Lowry to strip DeRozan at midcourt before racing in alone for a one-handed slam.

"I knew they were going to be aggressive, trying to make a play on the ball and then foul," DeRozan said. "I've just got to be more aware."

Traded to San Antonio in the offseason deal that sent Leonard to Toronto, DeRozan received a warm welcome but was denied a second victory over his former team. He finished with 23 points.

Lowry and DeRozan embraced near center court following the final whistle as the sellout crowd of 20,058 cheered its approval.

Fans rose for a standing ovation when DeRozan and the Spurs jogged out for pregame warmups, and were on their feet again when San Antonio's starters were introduced.

The longest, loudest cheer came after a tribute video that ran during the first timeout. With the crowd roaring, DeRozan got up from the bench and walked onto the court, acknowledging the fans with several waves.

"To come back here and get a reception like that is definitely humbling, beyond gratifying," DeRozan said. "I appreciate it."

"I thought it was a great game, a real competitive game," San Antonio coach Gregg Popovich said.

The Raptors took a 101-100 lead on Lin's jumper with 6:52 to go - part of a 9-0 run.

San Antonio overcame a six-point deficit, reclaiming the lead on Bertans' two free throws with 1:36 left - the first of four lead changes in the final 1:36. Bertans missed a potential go-ahead basket with less than 3 seconds left, and Lowry sealed victory by grabbing the rebound.

Leonard made two free throws with less than a second to play before Belinelli missed a potential game-tying 3-pointer at the final buzzer.

TIP-INS

Spurs: DeRozan had eight assists. He had his first career triple-double when the Spurs routed the Raptors 125-107 in Texas on Jan. 3, finishing with 21 points, 14 rebounds and 11 assists. ... G Derrick White returned to the starting lineup after missing the previous five games because of a sore right heel. He scored seven points in 20 minutes. ... C Jakob Poeltl, who was traded along with DeRozan, got a nice cheer when he entered the game late in the first.

Raptors: Raptors coach Nick Nurse was ejected after picking up a pair of technical fouls for arguing a blocking call against Green in the third. ... Leonard shot 2 for 12 in the first half and Toronto was 5 of 30 on 2-point attempts in the opening two quarters. ... G Jodie Meeks dressed but did not play in his first game since signing a 10-day contract Wednesday. ... Toronto is 17-6 against Western Conference opponents.

SERGE-ING

Ibaka has scored 10 or more in 21 straight games, matching a career-best streak. He also did it in 2014.

EXCHANGE RATE

Lowry said DeRozan picked up the tab when the two friends met for dinner Thursday night.

"His American dollars are strong right now so we took advantage," Lowry joked.