LOS ANGELES (AFP) - Seth Curry scored a career-high 24 points and nailed a key lay-up with 17.3 seconds to play on Sunday, as the Dallas Mavericks shocked the Spurs 105-101 to halt their 12-game losing streak in San Antonio.
The Mavericks hadn't beaten their Texas rivals in San Antonio since Nov 26, 2010.
The Spurs lost a second straight National Basketball Association game for the first time since November, and endured their first home defeat after holding at least a 10-point half-time lead since March 7, 2008.
The Mavericks were up 100-92 with 3:48 to play after the second of back-to-back jump shots from Harrison Barnes.
San Antonio's LaMarcus Aldridge hit two free throws and a dunk - assisted by Danny Green - as the Spurs narrowed the gap to 100-96 with 2:15 remaining.
Two free throws from Kawhi Leonard trimmed the deficit to 100-98, before the Mavs' Wesley Matthews made one of two from the free throw line to make it a three-point lead with less than a second remaining.
After Leonard missed a jump shot, Curry powered through the Spurs defence for a basket that made it 103-98.
San Antonio's Manu Ginobili drained a three to narrow the gap again, but Yogi Ferrell, who signed a 10-day contract with the Mavericks some 36 hours earlier, made two free throws with 7.3 seconds left to seal the win.
Ferrell, who was undrafted out of college, played 10 games with the Brooklyn Nets this season but has toiled mainly in the developmental league.
He was a surprise starter in his first game with his new team and finished with nine points and seven assists.
After a couple of early defensive mistakes guarding Tony Parker, he settled down and did a solid job on San Antonio's veteran point guard, admitting he was nervous when he got the starting nod.
"It was eye-opening for me when coach told me," he said. "But as the game went on, I just started playing."
Injuries to Deron Williams, J.J. Barea and most recently, the waiving of Pierre Jackson, gave Ferrell his opportunity.
"Give Yogi a lot of credit," said Mavericks star Dirk Nowitzki. "First game, starting against Tony Parker and he made two big free throws down the stretch. He's a fighter. He's strong in there. That was fun to watch."