Houston's coaching staff emphasized to the players that Boston led the league in fourth-quarter scoring.

So when they Rockets found themselves down by six entering the final frame they knew they'd have step things up to escape with a win.

Harden made sure they did that, scoring 13 of his 37 points in the fourth before Al Horford missed a shot just before the buzzer to allow the Rockets to hold on for a 107-106 victory Monday night.

"The fourth quarter we just picked up ... we just wanted to lock in and get stops and offensively be aggressive," Harden said.

The game was tied before Harden scored five straight points to make it 107-102 with less than a minute remaining. Avery Bradley made a jump shot and Harden received a flagrant 1 foul for elbowing Marcus Smart in the face. Smart made both free throws before Isaiah Thomas missed a layup.

But Houston knocked the ball out of bounds with 5.2 seconds left, giving Boston one last chance. Horford drove into the lane, but his shot rolled off the rim and Harden grabbed it to secure the victory.

"I felt good when I shot it, but it just didn't go down," Horford said.

Horford had 21 points and Thomas added 20 for the Celtics, who had won two straight.

It was the ninth 30-point game this season for Harden, who also had eight assists and seven rebounds.

An 8-2 run by Houston, powered by a pair of 3-pointers by Eric Gordon, cut Boston's lead to one with about 8 1/2 minutes left. Smart made a 3-pointer for the first of seven straight points for the Celtics that made it 96-88. Smart also had a big defensive play in that stretch when he blocked a one-handed dunk attempt by Montrezl Harrell.

Houston scored eight straight points, topped off with a dunk from Harrell, to take a 102-100 lead with about 3 1/2 minutes left.

Harden raved about Harrell's work.

"You see how he's flying around everywhere," Harden said. "He does a lot of different things, some things that don't show up on the stat sheet that helped contribute to this win."

The Celtics trailed by 12 early in the third quarter before using a 15-2 spurt to take a 68-67 lead with about 7 minutes left in the quarter. Boston made three 3-pointers in that span, capped by one from Horford. Houston missed five shots, including four 3s, and had two turnovers to help the Celtics close the gap.

"We guarded at a different level and our first unit played pretty well in the third," Celtics coach Brad Stevens said. "In one stretch in the fourth we turned the ball over and that was hurtful."

The Rockets were up by three points with 2 minutes left in the first half before Smart fouled Harden on a 3-point attempt and he made all three free throws. Houston had extended the lead to seven when Smart again fouled Harden on a 3-point try and his three free throws made it 58-48 at halftime.

TIP-INS

Celtics: James Young missed the game with an illness. ... Thomas received a technical for arguing a call at the end of the first half. ... Bradley finished with 16 points and 10 rebounds. ... Smart had 13 points.

Rockets: Made 12 3-pointers to extend their NBA record of consecutive games with at least 10 3-pointers to 20. ... Trevor Ariza started despite dealing with back spasms and had 15 points and eight rebounds. ... Gordon finished with 19 points and made four 3-pointers to give him six straight games with at least four 3s.

PERFECT

Harden tied a franchise record for most free throws without a miss by making all 18 of his attempts on Monday night. Kevin Martin also went 18 for 18 on March 20, 2011 against Utah. He lamented committing the offensive foul on Smart late instead of drawing the foul and getting a chance to go to the line and set the record.

"Of course I wanted two free throws at the end of the game instead of a flagrant, but we won," he said. "That's all that matters."

LATE PUSH

The Rockets have developed a knack for scoring late. After managing just 13 points in the fourth quarter of a 105-103 loss to Oklahoma City on Nov. 16 the Rockets have picked things up, averaging 27.9 fourth-quarter points in the last 10 games.

THEY SAID IT

Stevens on Harden: "Harden is a really good player. I don't know what else to say. We could go through and dissect every play, but overall he is just a really good player."

UP NEXT

Celtics: Visit Orlando on Wednesday.

Rockets: Hosts the Lakers on Wednesday.