By TIM REYNOLDS AP Basketball Writer

MIAMI (AP) — For years, Ray Allen's routine has not changed. Show up for work hours earlier than just about everyone else, go onto the court and take hundreds of jump shots.

It paid off for him on Tuesday.

And he'll be back out there on Thursday — since the Miami Heat season still has one game remaining.

Allen's 3-pointer with 5.2 seconds left in the fourth quarter capped a huge Miami rally plus essentially took the championship trophy out of San Antonio's hands, and the Heat found a way in overtime to hold off the Spurs for a 103-100 win.

"Ray did what he's done for so many years," said Heat coach Erik Spoelstra, whose team trailed by 13 in the second half and was down by 10 entering the final quarter. "And we've seen it on the other side so many times."

A pair of free throws by Allen with 1.9 seconds left in overtime sealed it, and on the last play of the game, Danny Green — who took Allen's 3-point Finals record earlier in this series — had no chance at getting a potentially tying shot anywhere near the rim, the play snuffed out by Miami's Chris Bosh.

So Allen lost his record in these NBA Finals.

He still has a chance at what he wants most: A second championship. It's why he came to Miami.

"There's a lot of shots that I've made in my career," Allen said. "But this will go, you know, high up in the ranks, because of the situation."

And without him, Game 7 probably wouldn't be happening for Miami.

"This is the reason why we wanted him, in games like this," Miami's LeBron James said.

The Spurs were up 95-92, and workers were surrounding the perimeter of the court with yellow rope in anticipation of the trophy-awarding celebration. Heat players, like Bosh and James, said they noticed and were upset by that move, and others around the team called it "disrespectful." When time expired, those workers were to rise and basically use the rope to keep fans and others from getting on the floor for the Spurs' party.

The Heat had other ideas.

One of the subtle moves that set up Allen's game-winner came with 19.4 seconds left, after Kawhi Leonard missed a free throw and Spoelstra inserted Bosh back into the game in place of Mike Miller. Leonard made the second to push the Spurs' lead to three, and James took a 3-pointer that would have tied it for Miami.

James shot missed and Bosh got the rebound. Allen took several steps backward, both getting ready to receive the pass and getting his feet ready for the shot that only would potentially decide Miami's season. He caught the ball, as James stood alone at the top of the key, both arms raised, wanting the shot.

"If it's not me, I have no problem with Ray taking that shot, man," James said. "He's got ice water in his veins. Like I've said before, Ray can be 0 for 99 in a game. And if he gets an open look late in a game, it's going down."

Sure enough, the shot went down. Allen never thought about passing the ball — shaking his head no, somewhat comically, when asked if shipping the ball to James was an option. He shot, waited and then saw the ball drop with a swish.

"When I parted ways with Boston, they went their direction and obviously I went mine," "The minute I got here, this team made me feel welcome. I didn't win it last year with this team, but they made me feel a part of it. The redemption has been winning 66 games this year and having the best record in the NBA, making it to the playoffs and getting to this point and being with a great group of guys."

After Allen's shot, the rope was quickly re-collected, and won't be back until Thursday night.

Question now is, how will the Spurs collect themselves?

"I have no clue how we're going to get re-energized," the Spurs' Manu Ginobili said. "I'm devastated. But we have to. There's no Game 8."

The 2013 NBA championship comes down to one game: Winner take all, Game 7, Thursday night. No one could have envisioned this when the Heat talked Allen out of taking a longer, more lucrative deal to stay with the Celtics last summer and successfully lured him to South Florida instead.

He scored only nine points, grabbed one rebound, had two assists. The numbers were downright paltry compared to LeBron James' 32 points, 11 assists and 10 rebounds, but certainly Allen earned a ton of the credit.

When time expired, he skipped toward midcourt and let out a scream. A few moments later, he walked off the court coolly, a white towel draped over his neck, slapping a few hands.

Allen had been the best 3-point shooter in Finals history, making 22 of them in the 2008 series with the Celtics. Green took his record in Game 5, and now has 26 for the Spurs heading into Game 7.

Given a choice, there's no question what Allen would want more: His record back, or a second ring.

His thoughts, down the stretch: "Until the clock runs out," Allen said, "we still have an opportunity to win this game."

So when Bosh turned and found him in the right corner with a few seconds left, the opportunity was not only there, it was his. He set his feet well behind the line, let that quick-release shot of his fly, and waited for the outcome.

"It just gave us another life," James said.

Referees reviewed it, but there was no question that the shot was a 3.

"Bad. Very bad," Ginobili said. "It's a tough moment. We were a few seconds away from winning the championship and we let it go."

The Heat saw that last play differently, of course.

"We actually got a couple of decent looks out of it," Spoelstra said. "LeBron's first look, at least it was clean. That's all you can ask for at that time. But Chris made a heck of an effort to give us that second possession and found Ray."

And with that, it's on to Thursday night.

"If there's one guy that you want the ball to be swung to on a situation like that it's Walter Ray Allen," Heat forward Shane Battier said. "After years of doing that to us, it was great to be on the right side of that for once."

Join our Newsletter for the latest news right to your inbox