The Heat nearly squandered a 14-point lead midway through the fourth as the Celtics (16-3) ran off 13 straight points and got within 91-90 on Marcus Smart’s two free throws with 3:14 remaining.

Waiters’ responded with consecutive 3-pointers for a seven-point advantage. The first of the 3-pointers took the odd bounces that stopped the Celtics’ run and gave the Heat (8-9) the needed rally to withstand another Boston comeback.

“We needed to stop the bleeding,” Waiters said. “I feel like we had great looks but when the tide turns it’s hard.”

Boston’s final victory of the streak against Dallas on Monday required a rally from a 15-point deficit in the fourth quarter that ended with a Celtics’ win in overtime.

Dragic clinched the victory with three free throws in the final 28 seconds.

Waiters overcame a scoreless outing against Indiana on Sunday. He shot 11-for-24 from the field after an 0-for-10 shooting performance against the Pacers.

Related Coverage

Miami snapped an eight-game losing streak against the Celtics. The Heat had not defeated Boston since March 25, 2015.

In addition to the streak-ending victory over the Celtics, Miami shook off the embarrassment of a 25-point loss against the Pacers.

“I don’t even care about the result right now,” Miami coach Erik Spoelstra said. “It’s all about behavior and habits. Guys really brought a purity to the work, a focus, a discipline the past two days.”

“Teams are coming out and giving us their best shots,” Irving said. “They made shots and got into a bit of a rhythm. You can tell they were locked into this game. They wanted it and proved it.

“They kept hitting us. They deserved that win tonight.”

The Celtics cut a 16-point deficit to 66-58 on Smart’s jumper with 4:09 remaining in the third quarter. Miami, however, outscored Boston 13-5 the remainder of the quarter.

“We were able to erase back quickly to give ourselves a decent chance,” Celtics coach Brad Stevens said. “We have to get better at what we’re trying to do.”

Behind Dragic’s 20 points, the Heat built a 17-point lead in the first half. Dragic’s two free throws with 5:15 remaining in the second period gave Miami its largest lead of the half at 43-26.

Al Horford’s jumper with 30 seconds remaining in the half got the Celtics within 10-points before Dragic’s 3-pointer with 11 seconds left gave the Heat a 54-41 lead at halftime.

“We know that Boston is a great team and they will make a run,” Dragic said. “But we were really cool and calm.”

NOTES: Celtics coach Brad Stevens limited F Marcus Morris’ minutes against Miami because of knee stiffness. Morris played 21 minutes and scored 14 points as a reserve. ... The Celtics fell one game short of tying the 1959-60 squad that won 17 straight for the third-best run in club history. ... The Heat begin a four-game road trip Friday in Detroit. Miami is 4-4 in its first eight road games.