Miami won its fourth straight and handed Houston its fourth loss in a row.
Butler had his first triple-double of the season and 10th overall. The Heat came close to having two players with triple-doubles, with Bam Adebayo finishing with 10 points, 13 rebounds and eight assists before fouling out with about a minute left.
Miami trailed by 13 in the first half, but used a big run and great defense in the third to take a 12-point lead into the fourth quarter. They remained up by 12 after a dunk by Adebayo before Houston used a 9-0 run to get to 97-94 with less than a minute to go.
The Heat missed two shots after that but got the rebound both times, with Butler grabbing the second one. He was fouled and made two free throws with 10 seconds to go and the Heat added two more free throws in the final seconds to secure the win.
John Wall and Eric Gordon led the Rockets with 17 points each.
Miami pushed the lead to 15 on a 3-pointer by Max Strus with about eight minutes to go before Houston used a 10-3 spurt, capped by a 3 from DeMarcus Cousins, to get within 88-80 three minutes later.
A 3-pointer by John Wall got the Rockets within seven not long after that, but Miami scored the next five points to pull away again — 95-83.
The Heat used a 12-0 run to take a 70-59 lead with about 3 1/2 minutes left in the third quarter. They pushed the lead to 12 entering the fourth quarter after limiting Houston to just 10 points in the third.
Heat: The team learned shortly before game time that Tyler Herro would not be available in accordance with the NBA’s health and safety protocols, which would mean he either tested positive, had an inconclusive test or was flagged because contact tracing data suggested that he may have been exposed to someone else positive for COVID-19. The Heat were scheduled to fly to Salt Lake City later Thursday night for a game there Saturday against the Utah Jazz. It was not immediately clear if Herro would be cleared to fly with his team there, if he would remain behind in Houston, or return to Miami. If Herro is forced to stay behind, it might only mean they didn’t get a new test result back.
Rockets: Christian Wood missed his fourth straight game with a sprained right ankle. … Cousins had 16 points and 11 rebounds.
Heat: Play the second game of a seven-game trip at Utah on Saturday.
Rockets: Begin a three-game trip at New York on Saturday night.
AP Basketball Writer Tim Reynolds contributed to this report.