After letting a 23-point lead slip away and struggling to stop the Spurs in the third quarter Saturday night, the Rockets rallied in the final seconds to defeat San Antonio 112-106 and snap a seven-game losing streak at the AT&T Center.

With some late-game heroics, including clutch free throws from Dwight Howard, a momentum-stealing dunk from Chandler Parsons and a healthy dose of James Harden returning to form, the Rockets (13-5) won a game that might have been a loss a few weeks ago.

“A month ago, we might not win that game,” coach Kevin McHale said. “But I’ve seen the improvement. And I think this was a good win for us.”

Several Rockets, including Howard and Harden, have pointed to the Spurs as a team to emulate, and in the first quarter, the Rockets beat them at their game. They moved the ball well, were accurate from behind the 3-point line and had great bench production.

Early lead

Things were going so swimmingly that the Rockets led 55-32 midway through the second quarter.

“I liked a lot of what we did early in the game,” Howard said. “The way we came out and really put together a big run and played our game. To do that against a really good team like the Spurs is tough.”

To maintain that type of play against a team like the Spurs is tough, as well. Late in the second quarter came the Tony Parker show. The five-time All-Star scored 10 points to fuel a 14-0 Spurs run, and just like that, the big lead dwindled.

And in case the Spurs needed motivation for the second half, coach Gregg Popovich picked up a technical foul for yelling at McHale and the referees when his counterpart stood close to Tim Duncan on an inbounds pass.

In the third quarter, the Spurs chipped away, largely due to Duncan and Parker, who combined for 16 points in the quarter.