The Golden State Warriors' five-match winning run at home ended in dramatic fashion following a late three-pointer from the Detroit Pistons' Saddiq Bey.
The match looked to be heading for overtime when Klay Thompson levelled for the Warriors with his own three-pointer with just 2.3 seconds left.
But the Pistons used a timeout to get back up the court and Bey's long shot handed them a 122-119 victory.
"I had one second so I didn't have time to think - I had to shoot," said Bey.
"I'm just grateful it went in. I don't even remember, I kind of blacked out a little bit."
Stephen Curry, who was the MVP as the Warriors won the NBA Finals last season, missed his 10th consecutive game.
The 34-year-old point guard, who suffered a partial dislocation of his left shoulder in a defeat at the Indiana Pacers in mid-December, is due to have his injury re-evaluated on Saturday.
The Warriors' head coach, Steve Kerr, praised his players after they fought back from five points down in the final quarter against the Pistons, who had the worst record in the Eastern Conference going into the match in San Francisco.
"I just told the guys how proud I am of them for holding down the fort these last couple weeks," said Kerr.
Despite their recent improved run, it was a 19th defeat in 39 matches this season for the injury-hit Warriors as they struggle to force their way back into the play-off picture following a stuttering start to their title defence.
Elsewhere, Dennis Schroder scored a season-high 32 points for the Los Angeles Lakers, who won 112-109 at home to the Miami Heat for a fourth victory in five matches despite missing star man LeBron James through illness.
John Collins scored 22 points and made 12 rebounds as the Atlanta Hawks ended a run of four defeats with a 120-117 victory away to the Sacramento Kings.
Wednesday's full NBA results
Across the BBC banner
Friends Will Be Friends: Stanley Tucci and his best friend talk about their love of food and art
The girls paying for their parents' sins: Watch Pretty Little Liars: Original Sin on BBC iPlayer now