SAN FRANCISCO (AP) — Confetti fell and Stephen Curry flexed. He danced and celebrated a January victory against the lowly Rockets as if it were a playoff game in May.

Golden State Warriors guard Stephen Curry celebrates after the Warriors defeated the Houston Rockets in an NBA basketball game in San Francisco, Friday, Jan. 21, 2022. (AP Photo/Jeff Chiu)

Oh how the Golden State Warriors needed this one. Curry needed this one.

His dependable, smooth shot abandoning him for much of the night again, Curry nailed a game-winning 20-foot jumper from the top of the key as the clock hit 0.0 and the buzzer blared, scoring 22 points and sending the Warriors past Houston 105-103 on Friday.

“It felt great,” Curry said. “The way the whole last 48 hours have been with the way we played grinding out last night, going overtime, losing, the disappointment with that and then coming into this game, the back and forth, just grind-it-out mentality we had, the resilience we showed to give ourselves a chance the second half was impressive.

“It reminds you to keep the big-picture perspective on what we’re trying to do.”

The sellout crowd went into a frenzy as Curry pumped his arms in triumph at midcourt — exhaling after he had missed two 3-pointers in the final 1:48. It was the first buzzer-beating winning shot of Curry’s career. He had seven to win games in the final 5 seconds.

It had been since high school.

Golden State Warriors guard Stephen Curry, left, chases the ball after fouling Houston Rockets guard Kevin Porter Jr. (3) during the first half of an NBA basketball game in San Francisco, Friday, Jan. 21, 2022. (AP Photo/Jeff Chiu)

“It’s just how the game kind of goes, I hit some shots .1, .4, 1 second, whatever it is, big shots,” he said. “But it’s a different feeling when it’s a walkoff. It’s good to know what that feels like finally.”

Curry overcame a slow start to lift the tired, mentally spent Warriors back up from an ugly loss to Indiana a night earlier. He also dished out 12 assists.

“I was shocked. I just talked to him. It was his first ever walkoff game-winner,” coach Steve Kerr said. “Obviously he’s had plenty in the final seconds. I didn’t know that. A fitting end to a grind-out game that we really needed. I think in some ways we had forgotten how hard you have to play to win in this league.

“I think tonight our guys remembered that lesson.”

Houston had the ball with 11.5 seconds left and the game tied at 103, but Garrison Mathews missed a 3 and Otto Porter Jr. secured the rebound before a Warriors timeout.

Porter’s driving dunk with 3:38 to play got Golden State within 101-99.

Curry missed his initial eight shots — 0 for 5 in the first quarter when he had only a single free throw — and finally made his first field goal with a 3-pointer 48.8 seconds before halftime. Golden State trailed 54-43 at the break then went into the final quarter tied at 76.

The reigning scoring champion shot 6 for 21 with four 3s. Andrew Wiggins added 17 points for the Warriors following a 121-117 overtime loss to the undermanned Pacers on Thursday night.

Klay Thompson sat out the second game of the back-to-back and Jordan Poole scored 20 while returning to the starting lineup as rookie Jonathan Kuminga came off the bench.

Poole went down hard with 1:17 left in the third when Mathews clobbered him in the face, a play that was ruled a Flagrant 1 foul after review.

Christian Wood had 12 of his 19 points in the first quarter and grabbed 15 rebounds and Kevin Porter Jr. scored 17 points for Houston, which wrapped up a five-game road trip. The Rockets came in having won three of four but dropped their fifth straight to the Warriors including three in a row in the Bay Area.

Golden State used a 33-point third quarter to get back in it a day after the Warriors shot a dismal 9 for 42 from 3-point range and coach Steve Kerr blamed himself for not having the team prepared to play a Pacers team missing three starters with injuries.

Golden State committed 21 turnovers against Indiana, another 19 on Friday, and hasn’t played the kind of smothering defense that defined the Warriors early on this season — and they are clearly missing injured Draymond Green’s presence on both ends.

“Without Draymond, we lose a huge part of who we are identity wise, force wise, competitive wise,” Kerr said.

ENCOURAGING WORDS

Thompson received some words of wisdom during his pregame warmup from Hall of Famer Rick Barry.

Thompson will continue to “move up a couple of minutes every week or so” in terms of playing time, Kerr said, and for now the Warriors are sticking with 22- to 23-minute range.

In a nod to Barry, Curry had a little fun at the end of his shooting routine — he twice tried an underhand 3-pointer from the baseline to no avail, turning to Barry with, “How’d you do it?”

SPECIAL VISITOR

The No. 3 Arizona men’s basketball team, fresh off a win at Stanford a night earlier and preparing to play at California on Sunday, got to spend a few minutes with star alums Kerr and Andre Iguodala — and Warriors assistant Bruce Fraser, another former Wildcat, said hello, too.

TIP-INS

Rockets: Jalen Green was 0 for 11, missing all five of his 3-point tries. … In a 116-111 win Wednesday at Utah, Houston committed a season-low nine turnovers and had 24 assists. The Rockets committed 12 turnovers and had 25 more assists. … Houston led by as many as 15.

Warriors: Retired Warriors COO and Hall of Famer Rick Welts was honored with a medallion on the Warriors Walk of Fame outside the arena he helped build. It also was Welts’ 69th birthday. … Kevon Looney had 12 rebounds for his career-best fifth straight game in double digits on the glass.

UP NEXT

Rockets: Host San Antonio on Tuesday night beginning a four-game homestand that includes a Jan. 31 date with the Warriors.

Warriors: Host the Jazz on Sunday night having won the last three against Utah following five straight losses in the series.