For all the Rockets did along the way, they had to do more. They had to do it with the game on the line down the stretch, against the team with a pair of enormous, fresh championship rings earned by winning in the final, crucial minutes.

The Rockets moved the ball and made shots and built leads that swelled to as many as 15 points. They got huge performances from Terrence Jones and Pat Beverley. They even somehow stopped LeBron James in the second half, swarming into his path until he settled for jumpers and, in the most shocking development of all, missed.

But none of that was enough.

The Miami Heat made their charge. The game was tied midway through the fourth quarter. The Rockets were rapidly fading. With that, the Rockets did something more significant than they had in the first 42 minutes, answering the run to stun the Heat 106-103 on Tuesday night at Toyota Center by doing all the things they had done to build those leads.

“Early in the season, we probably would have let one slip away,” said Rockets guard James Harden, who had 11 assists, the first time in his career he has been in double digits in consecutive games. “We missed some shots. They made some shots. Kind of got down on ourselves. But we’ve come a long way.

“We’re getting better. We held our composure, got some good buckets at the end of the day and got some stops.”

With the game tied at 93 with six minutes remaining, the Rockets scored on five of their next six possessions, pushing the lead back to nine points. More than just make shots, when the Heat trapped on the ball, the Rockets kept it moving in ways they had not during the lulls. The Rockets had their usual problems with turnovers, with 18 leading to 23 Miami points. But in the final eight minutes, they committed just one.

On the other end, the Rockets stuck to their defensive game plan, sending help in front of James and Dwyane Wade and taking their chances on the Heat’s perimeter shooting.

The Heat made just 3-of-19 3-pointers before Michael Beasley lit up the fourth quarter, scoring 13 of his season-high 24 points. But the Rockets continued to take away the lane, with James making just 1-of-7 shots, most without getting to the rim where he has torched the Rockets.