It was Michael Beasley who came to the rescue, pouring in 28 points and adding five rebounds and four assists in the Bucks 109-107 win over the Spurs in San Antonio.
The Bucks ended a 2-game losing streak and a nine-game slide against the Spurs.
Jabari Parker added 22 points and seven rebounds, while Malcolm Brogdon had 17 points, six rebounds and six assists.
Brogdon made one of two free throws with 7.1 seconds left, giving the Spurs a chance to tie or win. But Manu Ginobili missed badly on a three point try from the corner.
Kawhi Leonard led the Spurs (30-8) with 30 points.
The Bucks improved to 19-18 and will return to action on Friday night at home against the Miami Heat.