MIAMI (AP) — They were down by five points twice in the final two minutes of the fourth quarter. They wasted two chances to win in the last second of regulation, then found themselves trailing on two occasions in overtime.

No problem.

Nothing seems to faze the Miami Heat.

Jimmy Butler had 25 points, nine rebounds and nine assists, plus the go-ahead free throw with 2.3 seconds left in the extra session, and the Heat found a way to beat the Philadelphia 76ers 117-116 on Saturday night to improve to an NBA-best 15-1 at home.

“We never give up,” Butler said.

“Yeah, it’s crazy,” coach Erik Spoelstra said.

“We always fight back,” Miami’s Goran Dragic said.

Correct on all counts. The Heat moved back into the No. 2 spot in the Eastern Conference and assured themselves of no worse than a split of the four-game regular-season series with Philadelphia — after both teams went through a first in their franchise histories.

Miami, which topped Indiana on Friday, won one-point games on back-to-back days for the first time. Philadelphia, which fell in Orlando on Friday, lost one-point games on back-to-back days for the first time. The last time the 76ers lost consecutive games — ones that weren’t on a back-to-back — by exactly one point was in January 1995.

“To do lots of good things and then just at the end to make some plays you wished you had back makes it difficult to swallow,” 76ers coach Brett Brown said.

Dragic scored 19, while Tyler Herro and Duncan Robinson each had 16 for Miami. The Heat improved to 6-0 in overtime games and 8-1 in games decided by five points or less.

Joel Embiid had 35 points and 11 rebounds for Philadelphia, which has lost 10 of its last 14 on the road. Former Heat guard Josh Richardson had 17 points in his first time in Miami as an opponent, and Ben Simmons had 15 points and 11 assists.

Butler got fouled by Al Horford on Miami’s final possession, then made the second of his two free throws for what became the game-winner. Philadelphia’s Tobias Harris had a good look at a corner 3-pointer as time expired, but it bounced off the rim.

That alone was plenty of drama. But there was oodles more.

The end of regulation was wild, with Philadelphia twice holding five-point leads in the final 1:47 and not being able to finish things off off — then Miami missing a box-out that would have won the game in the last second.

With Miami down by two, Butler punched the ball away from Embiid with 12 seconds left in regulation. It went to Herro, who made a 3-pointer with 6.9 ticks remaining to put Miami up one. Another free throw pushed the lead to two, when Richardson went to the line to tie the game.

He missed the first and intentionally missed the second. Simmons swooped in to grab the rebound and score in one motion to tie the game. Miami had a chance to win it right there but misfired on an inbounds pass and to overtime they went.

“Obviously, we’re disappointed,” Simmons said, after Philadelphia fell to 1-2 against Miami this season and 4-10 in its last 14 road games. “There are lots of things we have to work on as a team.”

TIP-INS

76ers: Brown used his challenge with 1:53 left in the first half, arguing that Simmons did not commit what would have been his third foul against Bam Adebayo. He was correct. … Embiid took off his sweaty jersey for a fresh one at the scorer’s table before checking back in with 3:41 remaining in regulation.

Heat: Butler was 1 for 6 in the first half, his only make coming with 1:10 left before intermission. … Robinson started 6 for 6, including four makes from 3-point range, but committed his fifth foul with 5:16 left in the third. … Miami has reached 100 points in all 16 games at home this season, tying the second-longest such single-season streak in team history. The Heat had 23 consecutive home games of 100 or more points from Dec. 7, 1991 to March 13, 1992.

FAUX FIGHTS

Richardson and Adebayo remain extremely close friends and got playfully rough with one another. Richardson made a 3-pointer in the second quarter while getting fouled by Adebayo, then gave his former teammate a swat on the backside before finishing off the four-point play. So in the third quarter, when Richardson fouled Adebayo to save what likely would have been a dunk, the Heat center had a few good-natured words and animated points toward him. “That’s my guy,” Adebayo said.

QUICK TURNAROUND

Philadelphia scored 16 points in the game’s first 8:55. It scored 17 points in the next 3:02, quickly turning an early eight-point deficit into a five-point lead after the opening quarter.

UP NEXT

76ers: Visit Indiana on Tuesday.

Heat: Visit Washington on Monday.