MIAMI -- Given that the Boston Celtics had trailed in the fourth quarter in eight of their 16 straight wins, it was clear it would take an extreme effort to snap their streak.

Or maybe just a lucky bounce off the top of the backboard.

The Celtics trailed for most of Wednesday night's game against the Miami Heat but were within a point late in the fourth quarter. That's when Miami's Dion Waiters took a 3-point shot that bounced off the rim, off the top of the backboard and back down through the hoop with 3:14 left.

It extended Miami's lead to four and stalled the Celtics' run for good, and the Heat eventually handed Boston its first loss in 35 days, 104-98.

"It's tough, but I'm proud of this group," Celtics forward Al Horford said. "We put ourselves in position to win a game there, and we didn't make the plays down the stretch. We have to learn from that.

"It wasn't like we were necessarily dominating during the streak. But the will of this team is something that needs to be accounted for."

Perhaps it was a case of the always-powerful South Beach flu.

Or maybe Kyrie Irving was due for a rough night after a stellar 47-point performance Monday.

But the Celtics, who hadn't lost since starting the season 0-2, struggled mightily in the first half, shooting 33.3 percent from the floor while scoring just three points off 10 Miami first-half turnovers.

Irving finished with 23 points on 11-of-22 shooting, while rookie Jayson Tatum added 18. Waiters hit a pair of 3-pointers in the final minutes to finish with 26, while Goran Dragic led Miami with 27.

The Heat led by as many as 18 points in the first half and went into halftime leading 54-41, with Dragic having scored 20.

The Celtics' 104-98 loss to the Heat on Wednesday night was their first in 35 days. AP Photo/Lynne Sladky

The Celtics' bench was the most glaring problem in the opening half, with Marcus Morris, Marcus Smart and Terry Rozier combining to shoot 3-of-15 in 36 combined minutes.

"That's a really well-coached team, and they played their butts off," Celtics coach Brad Stevens said. "They deserved to win that game.

"When we're locked in and we're executing, we're pretty good. However, we go through too many lulls when we're not."

In the second half, the Celtics were hoping to do what they had been doing throughout the season: recover from a rough start.

Heading into Wednesday night's game, the streaking Celtics had been making their wins fairly stressful. Against the Oklahoma City Thunder on Nov. 3, the Celtics trailed by 18 in the third quarter before Irving put on a show down the stretch for that win.

The Heat managed to maintain a double-digit cushion in Wednesday's third as the Celtics' offense stalled, resulting in a lot of isolation situations late in the shot clock.

Irving scored just two of his team's 22 points in the quarter, and Boston's win streak would require a 16-point, fourth-quarter comeback if it were to continue.

"You could tell they were locked in all night," Irving said. "They wanted it. You gotta credit their energy."

Boston showed much more life in the fourth quarter, starting so aggressively that the Celtics were in the bonus with nine minutes left. With three minutes remaining, behind a 13-0 run and a pair of 3s from Tatum, Boston was suddenly within a point, 91-90.

That's when Waiters attempted to hold off Boston on his own. The Heat guard hit a critical 3-pointer -- one that bounced off the top of the backboard before falling through -- to put Miami back up by four. He followed that with a step-back 3 in the corner -- no backboard necessary this time -- to extend the lead to 97-90.

"To me, that's not luck," Stevens said. "They create that with their pace."

Waiters followed with an air ball, but with the help of a Hassan Whiteside tip-in with 1:10 remaining, the Heat stopped the Celtics' win streak and maybe gave themselves a springboard win.

The Celtics, meanwhile, were reminded what losing feels like for the first time in 35 days.

"There's still a lot to accomplish going forward," Irving said. "It was a nice streak. But it was time to come to an end."