MIAMI — The Miami Heat get leads. They just can't hold them.

And this time, the Minnesota Timberwolves were the beneficiaries of another late-game collapse.

Jordan McLaughlin’s layup with just under nine seconds left put Minnesota ahead for good, D’Angelo Russell led all scorers with 27 points and the Timberwolves added to Miami beat the Heat 129-126 on Wednesday night.

The Wolves were down by 12 with 3:59 left, staring squarely at what was about to be their 19th loss in their last 20 games. That is, until a 20-5 run to end the game slapped the win out of Miami's hands.

“You just can't say enough about the group in the locker room," Timberwolves coach Ryan Saunders said. “It's a special group the way these guys are pushing through a lot of unknowns, a lot of change, a lot of adversity right now so I'm just really thrilled for this group.”

Malik Beasley scored 21 points, Juancho Hernangomez tied a season-high with 17 and McLaughlin added 13 for Minnesota.

Jimmy Butler’s two free throws with 13.8 seconds left put Miami up 126-125, but McLaughlin’s layup on the next Minnesota possession put the Timberwolves on top to stay. Butler’s layup with 3.2 seconds left got blocked by Russell, and the Wolves held on.

“We just don't know," Heat guard Goran Dragic said. “This is the time we need to win. The playoffs are around the corner. It's just frustrating. Feels like we're not the same team that we were in the first half of the season."

Kendrick Nunn led Miami with 24 points. Bam Adebayo had 22 points and 10 rebounds and Butler — back after a two-game absence for personal reasons — had 18 for Miami. The Heat fell to 23-4 at home and have dropped seven of their last nine overall.

The Heat have had major trouble closing games of late — a 22-point lead late in the third quarter against Cleveland on Monday was frittered away in what probably was the worst loss of the season, until now anyway — and a long film session and meeting on Tuesday clearly didn’t solve the issue.

“I just think this is our period of the season where there's some adversity," Heat coach Erik Spoelstra said. “It's a good thing when the thing we need to work on is what to do when we have double-digit leads. That shows we're capable of getting to that point. We just have to close out and finish."

The Heat stayed a half-game ahead of Philadelphia in the race for the No. 4 spot in the Eastern Conference playoff race. Philadelphia lost in Cleveland earlier Wednesday, a game where 76ers star Joel Embiid departed early because of a shoulder injury.

Miami led 121-109 with 3:59 left, and 123-112 after a layup by Butler 24 seconds later.

And Minnesota — a team that came into the night with one win in a span of 48 days — still wasn’t finished off. The Timberwolves scored the next 11 points to tie the game, getting five of those points from Beasley and a tying free throw from McLaughlin with 46 seconds left.

“That's a great team, well-coached, numerous amount of weapons offensively and defensively with tactics," Russell said. “So for us to come out on top with the win, mano-e-mano, was great.”

TIP-INS

Timberwolves: Minnesota’s 27 attempts from 3-point range in the first two quarters was a first-half franchise record. ... The Wolves are 4-0 in road games against Southeast Division teams this season, and 6-19 in all other road contests.

Heat: Adebayo played through a sprained right ankle, pushing his consecutive-game streak to 144 — extending the fourth-longest such streak in team history. ... Goran Dragic’s first basket was a 3-pointer, and that pushed him one point past Grant Long (5,473) for 10th on the Heat career scoring list. ... Nunn got his third consecutive rookie of the month trophy in a brief halftime ceremony.

JOHNSON RETURNS

Wednesday marked James Johnson’s first game back in Miami since the trade that sent him to Minnesota earlier this month, a move that sent Andre Iguodala, Jae Crowder and Solomon Hill to Miami from Memphis. “Hell yeah, we played for him," Russell said. Johnson had 11 points in 23 minutes.

LOOKING AHEAD

A large contingent of fans from Slovenia were in attendance Wednesday — and more are coming Friday, when the Heat play host to the Dallas Mavericks. At last season’s Dallas-at-Miami game, more than 2,000 Slovenians were in attendance to watch their nation’s two best NBA players, Dragic and Dallas star Luka Doncic, go head-to-head.

UP NEXT

Timberwolves: At Orlando on Friday night.

Heat: Host Dallas on Friday night.

___

More AP NBA: https://apnews.com/NBA and https://twitter.com/AP_Sports