MIAMI – Dirk Nowitzki and the Dallas Mavericks put a stunning end to their misery in Miami.

Now they can win their first NBA title without ever returning to south Florida.

Nowitzki made the tie-breaking layup with 3.6 seconds left, and the Mavericks roared back from 15 points down in the fourth quarter to beat the Heat 95-93 on Thursday night and tie the NBA finals at one game apiece.

Capping a furious rally by scoring Dallas’ final nine points, Nowitzki made two late baskets left-handed, despite a torn tendon on that non-shooting hand. He finished with 24 points.

Dwyane Wade had 36 points for Miami, but his desperation 3-pointer was off at the buzzer.

“I thought defensively we really got into them,” Nowitzki said of the rally. “We pressured them full court and we scrambled defensively. We even gave up some offensive rebounds, but we kept scrambling.”

Game 3 is Sunday in Dallas.

Seemingly out of the game when the Heat led 88-73 with 7:15 remaining, Dallas held the Heat to one field goal from there, a 3-pointer by Mario Chalmers with 24.5 seconds that tied it just two seconds after Nowitzki’s 3-pointer made it 93-90.

But after a timeout, Jason Kidd ran the clock down before getting the ball to Nowitzki, who drove into the lane, spun back to the left and made the layup.

Jason Terry, largely silent since the first half of Game 1, fueled the comeback with a couple of jumpers and finished with 16 points. Shawn Marion had 20 points for the Mavericks, who had lost four straight finals games in Miami since taking a 2-0 lead in the 2006 series.

They were about to go down 2-0 this time before Nowitzki, who insisted his injured finger wouldn’t hinder him, led a rally even more amazing than the one that won Game 4 of the Western Conference finals, when the Mavs trailed Oklahoma City by 15 in the fourth quarter before pulling it out in overtime.

LeBron James scored 20 points for the Heat.

He and Wade were running by and over the older Mavs for three quarters, and it appeared the only thing that could slow them down was that big trophy they would soon be holding.

Not so fast.

Wade angered the Mavs, particularly Terry, when he held his follow-through after his 3-pointer from the corner with 7:15 left capped a 13-0 run and made it 88-73.

The Heat suddenly went cold, holding the ball too long on possessions and forcing James and Wade to attempt long jumpers with the shot clock winding down instead of playing to their strengths.

A series of those missed jumpers eventually ended with the Mavs getting possession and Nowitzki making a layup that tied it at 90 with 57 seconds left.

The Heat lost for the first time in 10 games at home in the playoffs and will have to win at least once in Dallas to force the series back to Miami.

The Heat held the Mavs, whose offense was so precise in their victories over the Lakers and Oklahoma City, to one of their worst performances of the postseason in Game 1. Yet Miami didn’t expect to shut down Dallas the way it did Boston and Chicago in the last two rounds.

“We know what to expect from them. They are going to hit back. And we wouldn’t expect anything less than that,” Heat Coach Erik Spoelstra said before the game. “We have got to bring our best defensive game, knowing that that’s a very poised, veteran ballclub.”

But Miami weathered the early storm and appeared to have nothing to worry about in the second half.

A 29-10 burst spanning halftime showed off the Heat at their athletic best: a dunk by James, a dunk by Wade, and a long alley-oop pass from Wade to James on the fast break that turned a 51-all halftime tie into a 57-52 lead.

And just when Dallas got it down to four late in the period, James drove right for a powerful slam that left Tyson Chandler throwing his hands up in the air as if to say “how do we stop that?”

Eventually they did.