The Miami Heat squeaked out a win over the Oklahoma City Thunder Tuesday night, but it was their performance at the free-throw line that stole the show

Miami set an NBA record in a 112-111 win, going 40-for-40 at the charity stripe, topping a 39-for-39 performance by the Utah Jazz in 1982. 

Victor Oladipo and Gabe Vincent embrace against the Thunder

Victor Oladipo and Gabe Vincent of the Heat on the court against the Oklahoma City Thunder at FTX Arena on Jan. 10, 2023, in Miami. (Megan Briggs/Getty Images)

Jimmy Butler completed a three-point play with 12.2 seconds remaining in the fourth quarter, giving Miami the lead and setting an NBA record in the process.

KINGS COACH MIKE BROWN UPSET WITH NBA FANS’ ALL-STAR GAME VOTING 

"It’s just a normal Tuesday night for the Miami Heat," Heat coach Erik Spoelstra said. "I think this is when we feel most alive, when everything just happens and when all of our competitive juices get out there. That’s the team we all can relate to. That’s the team I like."

Butler was responsible for 23 of Miami’s 40 made free throws, scoring 35 points on 6-17 shooting from the floor. 

Jimmy Butler shoots against the Thunder

Jimmy Butler of the Heat shoots against the Oklahoma City Thunder on Jan. 10, 2023, in Miami. (Megan Briggs/Getty Images)

CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM

Butler’s 23 makes from the line without a miss tied the second-most of all time, falling one short of James Harden and Dirk Nowitzki’s record of 24 straight without a miss. 

"I’m more excited that we won the game by one point," Butler told reporters after the game when asked about the NBA record from the free-throw line. 

CLICK HERE TO GET THE FOX NEWS APP

Jimmy Butler drives against the Thunder

Jimmy Butler of the Heat drives against Shai Gilgeous-Alexander of the Oklahoma City Thunder at FTX Arena on Jan. 10, 2023, in Miami. (Megan Briggs/Getty Images)

The close win for Miami followed a one-point loss to the Brooklyn Nets on Sunday, improving the Heat to 22-20 on the season. 

"We always talk about finding a way to win.... This is a good start to that," Butler said.

The Associated Press contributed to this report