The Houston Rockets appeared ready to roll to their eighth straight win Thursday night before they fell into some old, bad habits.

But just when it looked like his team might blow a 25-point fourth-quarter advantage, Kevin Durant stepped up and knocked down a couple of pressure 3s to lift the Rockets to a 113-102 win over the Philadelphia 76ers at Toyota Center.

Not only was it the team’s eighth straight win, but it was the sixth in that stretch decided by double figures. It also allowed the Rockets (51-29) to keep pace with the Los Angeles Lakers, who have the same record after beating the Warriors on Thursday night, for the Western Conference’s fourth seed, which will come with home-court advantage in the playoffs.

Still, after watching a 99-74 lead almost disappear thanks to a 20-2 Philadelphia run in which the Rockets turned the ball over seven times, Ime Udoka was in no mood to celebrate Durant’s big shots or the one Aaron Holiday hit that also helped stem the tide.

“It’s big (to have Durant in those spots),” the Rockets coach said. “He made two and Aaron made one, but you’ve got to have some poise and get into our sets, handle pressure and not be reliant on that to bail you out of the game when you have a big lead. It’s great that we have guys that can do that, him being obviously one of our closers, but we shouldn’t even get to that point, honestly.

When the 76ers cut the deficit to 101-94, Durant hit a 3, followed by another from Holiday to push the lead back to double digits with four minutes remaining. Philadelphia got with five in the final two minutes, but Durant hit another 3 to push the lead to 110-102 with 1:15 left.

The difference in pre-meltdown Rockets and meltdown Rockets was obvious: Turnovers. Houston had just five turnovers in the first three quarters and then handed it over nine times in the final period.

“They pressured and we didn’t have any poise,” Udoka said.

Still, the Rockets survived thanks to a big night from Durant, who finished with 29 points, while Amen Thompson and Jabari Smith Jr., had 19 each. Tari Eason came up big off the bench, scoring 15 points in 26 minutes. Josh Okogie, drawing a start instead of Reed Sheppard, nearly had a double-double, getting 9 points and 10 rebounds in 21 minutes.

It was enough to keep the Rockets in the hunt for that coveted No. 4 seed, although it will have to pass the Lakers, who own the tiebreaker over Houston. The Lakers finish their season against the Suns on Friday and Jazz on Sunday. The Rockets close with the Timberwolves and Grizzlies.

Philadelphia — which was playing without Joel Embiid, who had an appendectomy at a Houston hospital Thursday — led 10-8 in the game’s opening four minutes and that was its last lead of the game. Nine straight Rockets points, punctuated by an Eason 3-pointer, gave the Rockets a seven-point lead it would never relinquish.

The Rockets opened up things further after halftime, going on an 8-1 run to start the second half and pump up the lead to 81-57.