The Golden State Warriors needed a last-gasp shot from Harrison Barnes to secure a narrow 107-106 win over the Phoenix Suns at the Oracle Arena.
Stephen Curry and Klay Thompson continued their strong form to put the Western Conference leaders ahead by 11 heading into half time.
The visitors started to cut into their advantage after the break though, before TJ Warren scored 15 of his 17 points in the fourth quarter.
Warren's three-pointer with just over five minutes to go put the Suns in front after trailing for much of the game, but Curry quickly tied the scores for the Warriors.
The scores remained close through the final minutes, with Eric Bledsoe cancelling out another effort from Curry, but Barnes managed to find a way through to add the winning points with less than a second remaining.
The defeat leaves Phoenix on a five-game losing streak, all but ending their chances of clinching a playoff place, while the Warriors, who are already guaranteed top spot in the Western Conference, claim a 62nd win of the season.