The Celtics survive another scare and defeat Miami, 110-105, on Monday night at the Garden.

BOSTON – The scenario has played out on several occasions during this maddening Celtics season.

 They build a big lead early at the TD Garden, appear to be in total control, then watch the advantage slip away, most of the time resulting in a loss.

 On Monday night, in the next-to-last home game of the regular season, that scenario unfolded for the Celtics against the Miami Heat.

 They opened a 22-point lead during the first quarter, led by as many as 23 points in the second quarter, and had a double-digit advantage for a good portion of the third quarter.

 But the Heat threw a scare into the Celtics, getting within three points in the fourth quarter, and another rough loss seemed on the horizon.

 This time, though, the Celtics managed to survive, holding off the Heat, 110-105.

 The victory enabled the Celtics (46-32) to stay tied with the Indiana Pacers for fourth place in the Eastern Conference with only four games to go.

 The Celtics had problems with a zone defense that the Heat threw at them, and Goran Dragic was aggressive at the offensive end for Miami, but in the end, the comeback fell short.

 “We needed to have one of these where things were really going against us and we just found a way,’’ said coach Brad Stevens. “They keep coming. They’re really hard playing, they’re really well coached. We just got stagnant. We showed that we can play great against it and then we just slowed down a little too much.

 “We were great in the first half against it, probably the best we’ve played all year against the zone. When we really move it and get it quickly either through the middle or just a simple pick where we drive and penetrate we’re pretty good.’’

 Kyrie Irving led the Celtics’ offense with 23 points, hitting five 3-pointers, and scored five points in the final 1:25 after the Heat got within three.

 Al Horford recorded his second career triple-double – and first with the Celtics – with 19 points, 11 rebounds and 10 assists. His other triple-double came on Jan. 13, 2015 with the Atlanta Hawks against the Philadelphia 76ers.

 “It feels good,’’ said Horford. “There’s been a lot of games (where he was close). I looked over at my wife and she was like you better get it. I just tried to continue the right way and I’m glad it worked out in my favor and we got the win.’’

 Jayson Tatum scored 19 points to go with six rebounds and five assists while Marcus Smart (16) and Gordon Hayward (11) were also in double figures.

 Dragic led the Heat with 30 points, sparking the second-half comeback, while Dwyane Wade, in his final Garden game, scored 17 points and ex-Celtics forward Kelly Olynyk scored 14.

 The Celtics had an 11-point lead going into the fourth quarter and were up, 93-82, when Hayward scored a layup with just over nine minutes remaining. But Olynyk made a 3-pointer and Dragic scored on a layup to get the Heat within 93-87.

 Olynyk later made three foul shots to pull the Heat within 95-92 with 6:44 remaining and a Wade jumper made it 103-100 with two minutes to go. But Irving converted a three-point play with 1:25 remaining, then sealed the win with two foul shots with 16 seconds left.

 “They’re a scrappy team,’’ said Smart, who received the Red Auerbach Award prior to the game. “They make the game real ugly. They forced us to take the shots they wanted us to take instead of the ones we wanted to. Once we kind of got back in the groove of what we’re supposed to do, we were fine.’’

 Dragic scored 13 points in the third quarter as the Heat, who trailed by as many as 23 in the first half, got the deficit down to single digits.

 Dragic made 5 of 7 shots, including a pair of 3-pointers, and the Heat used an 8-0 run early in the quarter to put pressure on the Celtics to start the second half.

 He hit five baskets in the opening 3:42 and added a foul shot, helping the Heat close the deficit to eight.

 Miami moved within six later in the quarter, a 3-pointer by Irving, back-to-back baskets by Horford plus a 3-pointer by Marcus Morris with 3.7 seconds to go enabled the Celtics to lead, 88-77, going into the final quarter.

 After cruising along during the second quarter and holding that 23-point bulge, the Celtics held a 61-47 lead at halftime.

 The Celtics put together one of their best quarters of the season to open the game, building a 30-8 lead in the first 8:50 and leading, 36-17, after 12 minutes.

 They raced to a 17-2 advantage in the opening six minutes with Tatum scoring eight quick points after Smart began the game with the first five points.

 Jim Fenton may be reached at jfenton@enterprisenews.com. Follow him on Twitter at @JFenton_ent.