The Dallas Mavericks watched a 17-point halftime lead slip away on their home floor on Saturday night, but star Luka Doncic wasn’t about to let the win slip away too.

Despite three defenders in his face, Luka drained a high-arcing step-back three from the left wing as time expired, sending the home crowd into a frenzy and giving Dallas their second consecutive win, defeating the Boston Celtics 107-104 at American Airlines Center.

After the game, Coach Jason Kidd beamed about his star player’s love for “the moment” and how it reminded him of another Mavericks player who experienced championship glory with Jason 10 years ago, Dirk Nowitzki.

“That’s Luka…he’s done it so many times and it’s just a beautiful thing to watch in person,”Coach Kidd said. “I’ve played with a player like that before here. Everybody knows the ball was going to 41, and he delivered. I think everybody knew the ball was going to 77, and he delivered. He loves that moment. His teammates know that. And I would say the opposing team knew the ball was going to Luka. And there was nothing they could do.”

Boston tried, sending more or less their entire on-court defense the way of Doncic, who brought the ball up the court and got a switch off a pick by Kristaps Porzingis. That switch gave Luka the isolation matchup he wanted against Boston’s Josh Richardson instead of Marcus Smart. However, once it became obvious what Doncic was doing, Smart left Porzingis and raced over to get a hand in Luka’s face. So too did Robert Williams, who left Reggie Bullock alone in the corner to contest. All three gave Doncic very little breathing room, but the 22-year-old star had enough to step back and get off a high-arching rainbow with under two seconds left on the clock. It hung in the air that entire time, rattling around the rim and through the net just as time expired to give Dallas the victory.

Prior to the shot, the Celtics had tried to keep the ball out of Doncic’s hands first by giving their final foul, and then with a deflection which sent the ball flying out of bounds. But that gave Dallas the chance to inbound near half court, which Jason believes actually benefitted the Mavs in the long run.

“The ball was going to get into Luka’s hands,” Coach Kidd said. “When they fouled, and then we had the deflection that went out, it probably helped us a little bit more to give Luka more room. We took advantage of that.”

It was the end of a crazy second half in Dallas. The first half went off without a hitch for the home team. They played phenomenally on both ends of the court in the opening quarter, out pacing Boston 29-15 to build a 14-point lead. They had that lead as high as 19 points in the second quarter and settled with a halftime advantage of 17 points, seemingly set to avoid yet another close game. However, the Celtics came out aggressive in the third quarter and began hitting the threes that hadn’t fallen in the first half. Jayson Tatum hit three of them in the third, and tallied 13 of his 32 points in that swing frame, as Boston clawed back within striking distance down just seven entering the fourth.

“We talked about it at halftime. That was a really good [first] half for us on both ends, but knowing that Boston was going to come out being aggressive, take the temperature if they can make some threes to get back in the game. You’ve got to give them credit, they got back in the game. They were aggressive and we were kind of passive there. But we learned from that and we stayed together as a team. It’s easy to just pull apart and give in,” Coach Kidd said. “We knew they were going to make a run, but we kept our composure there, down the stretch.”

The lead did not change hands until the final minutes, when Smart capped a 16-6 Boston run with a trey to give the Celtics a 104-12 lead with 2:12 remaining. However, Dallas got the answer from the returning Porzingis, who was strong in his first game back after a five-game absence and tipped in a miss by Jalen Brunson with 1:39 remaining to knot the score at 104. Porzingis finished with 21 points, behind only Doncic (33 points) on the scoresheet for the Mavs.

“He was great,” Coach Kidd said of Porzingis. “[He] came up with a big block there at the end of the game, and also had a big tip-in for us to tie the game up. For his first time back after being out for five games, he was really good.”

After a few fruitless possessions from either side, including that big block by Porzingis, Doncic’s rebound of a miss by Smart gave Dallas the ball with 28.1 seconds remaining. The Mavs called a timeout with 16 seconds on the game clock and 12 on the shot clock. But rather than allowing the Mavs to shoot and give them one more chance with something around four seconds left, Boston opted to give their remaining foul, resetting the shot clock and setting the stage for Doncic to deliver the knockout blow.

The win was Dallas’ six this season and all six have come by fewer than 10 points, but while Coach Kidd would prefer his team not take it down to the wire every night, he knows the wins count the same regardless of the score.

“These wins, they all count when they go into the left column, so we’ll take it,” he said. “Coming off another close game in San Antonio, it just shows we’re paying attention to details down the stretch and being able to execute, not just on the offensive end, but the defensive end. Tonight it came down to Luka having the ball offensively and he delivered. In San Antonio, it was coming up with a stop. We can grow from this and we can only get better.”

The Mavs (6-3) return to action on their home court Monday night when they host the New Orleans Pelicans (1-9) at American Airlines Center. Tip-off is slated for 7:30 pm local time and the game can be seen on Bally Sports Southwest.