MIAMI (AP) — For a while, it looked as though a pair of long streaks were in jeopardy.

That is, until LeBron James finally got going — at the perfect time.

Dwyane Wade scored 22 points and set up James for a critical 3-pointer in the final half-minute, and the Heat extended their winning streak to 13 games by beating the Memphis Grizzlies 98-91 on Friday night.

"I thought this was one of our better wins of the season," Heat coach Erik Spoelstra said. "It was tough. We had to work for everything. We had to find a different way to win, deal with frustration ... and then make some plays down the stretch."

On a night when he shot just 4 for 14, James finished two rebounds shy of a triple-double, with 18 points and 10 assists. Shane Battier scored 14, Chris Bosh added 13 and Ray Allen had 10 for Miami, which snapped Memphis' eight-game winning streak.

"He's the best player in the world," Bosh said. "But we have the best supporting cast."

Down the stretch, James — who had 14 points, four rebounds and four assists in the fourth quarter alone — was simply too much. After managing only four points in the first three quarters, James still wound up reaching double digits for the 475th straight regular-season game.

"He made the big shot and that's all that matters," said Memphis' Marc Gasol, who led all scorers with 24.

Gasol tied the game with a pair of free throws with 2:44 left, before the Heat scored the next five. Bosh had a three-point play, and Wade took off in transition for a slam that put Miami up 90-85.

Gasol scored the next four, but Memphis got no closer. James calmly hit a 3-pointer with 24 seconds remaining to seal the win.

"I'm always confident in my next shot," James said. "D-Wade gave me a great pass and I was able to knock it down."

The Grizzlies got 14 points from Zach Randolph, who said he was bothered throughout after turning his left ankle on the game's first possession. Mike Conley added 14 for Memphis, which got 10 from Quincy Pondexter.

"I have no problem with the game," Grizzlies coach Lionel Hollins said. "We were right there. They just made a few more plays than we did down the stretch."

For the Heat, this week was filled with attention for things like pregame dunking exhibitions and their version of a "Harlem Shake" video — which generated more than 5 million views on YouTube in about 24 hours of being posted.

Then came a basketball game, the likes of which had not been seen in the NBA for almost 20 years.

According to STATS LLC, the most recent time before Friday that there was a game between two teams that were carrying at least 12- and eight-game winning streaks was Dec. 3, 1993, when Atlanta (which had won nine straight) beat Houston (which had won 15 straight).

In fact, the Heat-Grizzlies game was just the eighth in NBA history pitting two teams with active winning streaks of at least eight in a row.

Want more significance? Spoelstra and Hollins were announced earlier in the day as the Eastern and Western Conference coaches of the month, respectively. And news came just before tipoff that James was picked yet again as the East's player of the month, making him 4 for 4 in that department this season.

"Just a residual of team success," Spoelstra said.

Added Hollins: "I'm the head coach and I get the credit and I get the blame, but those guys have been playing extremely well ... coming together with all the turmoil and all the chaos that we've had."

So of course, in a game between the NBA's two hottest teams, the start was ice cold. The teams combined to miss 23 of their first 32 shots.

And for James, things were downright frigid.

After the best shooting month of his career — the three-time MVP made 64 percent of his shots in February, the best month of any NBA player with 200 attempts since Kareem Abdul-Jabbar shot 65 percent in March 1983 — James' run in March started in a decidedly different manner.

James made a 3-pointer on his first attempt of the night, then missed his next eight tries.

"You won't see that happening too many times," Wade said. "It was great that on a night where he didn't have it going offensively, he had trust in his guys and didn't force up 20-odd shots. He played to pass and he still was aggressive. We'll take it. We'll take it, him getting those numbers and us getting the win."

NOTES: Battier has at least one 3-pointer in 14 straight games, the fourth-best such streak of his career. ... Miami is at New York on Sunday, facing a Knicks team that has already beaten the Heat twice — by 20 points each time. "Our guys will look forward to playing this game," Spoelstra said.