ST. PETERSBURG -- What the ridiculously tenacious Tampa Bay Rays have accomplished this wacky September is beyond belief.

It was sportscaster Al Michaels who coined the question, "Do you believe in miracles?"

For the Rays, this goes even deeper than miracles.

It was motivational speaker Dr. Wayne Dyer who once wrote, "You'll see it when you believe it."

Seeing firsthand what the Rays have done is hard to believe.

They followed a script that ended early Thursday morning with a stunning 12-inning, 8-7 victory over the Yankees that had to be written by a force far greater than mere humans.

There is no other way to explain how the Rays' unbelievable march to the postseason evolved -- and ended.

"It goes beyond earthly measures," said Rays skipper Joe Maddon, who has to be 2011 American League manager of the year. "I mean this sincerely. You can't write this script. No one would believe how this happened tonight. We were in such a bad place, and [the Red Sox] were in such a good place."

Before many in the Tropicana Field crowd of 29,518 had found their seats on Wednesday night, the Rays were buried by the Yankees. It was 7-0 New York after five innings. The Rays had just two singles, ineffective lefty David Price was long gone and the Boston Red Sox were beating the Orioles in Baltimore.

It seemed obvious that Tampa Bay's gallant comeback was coming to a screeching halt -- a game short.

The Rays started the night tied with slumping Boston, struggling with a 7-19 swoon, for the AL Wild Card. Now, not even a one-game tiebreaker on Thursday at Tropicana seemed likely.

But on one of the most bizarre season-ending nights in baseball history, a night when the St. Louis Cardinals would nail down the National League Wild Card as the Atlanta Braves choked on their early season success, the Rays wrote history.

As the Red Sox became victims of one of the greatest collapses in recent years, the Rays stormed back from a nine-game deficit on Sept. 4 to win the AL Wild Card -- the most games overcome in September to get to the postseason in Major League history.

So, it was perfectly scripted for the Rays to erase New York's seemingly insurmountable lead with six runs in the eighth inning. And in the ninth, with two outs and Tampa Bay down to its last strike, pinch-hitter Dan Johnson sent Yankees reliever Cory Wade's pitch to the right-field seats to make it a 7-7 game.

In Baltimore, where a severe rainstorm had interrupted play, the Red Sox were clinging to a 3-2 lead and closer Jonathan Papelbon was just one out from victory when the Orioles rallied for two runs, putting Boston on the brink of going home for the winter with a 4-3 loss.

"I liked the idea of the rain delay [in Baltimore]," said Maddon. "I thought that might have helped us -- having them sitting around thinking about it, thinking about it. And then we get the six points. That had to add to the anxiety up there."

The end came for Boston at 11:57 p.m. ET.

Eight minutes later, at 12:05 a.m., Evan Longoria, facing a 2-2 pitch from Scott Proctor, homered just inside the left-field foul pole and it was over.

A delirious on-field celebration started and moved inside for the typical champagne-spraying party.

Moments before Longoria homered, the final score from Baltimore was posted. As it went up, the fans -- already on their feet -- let go with thunderous approval.

"We played baseball for the better part of five hours (4:54) and the end result came in a matter of seconds, it seemed like," Longoria said as giddy teammates doused him with champagne. "Their game ended with them losing, and our game ended the way it did."

Longoria said he didn't see the Red Sox score on the message board, but "as soon as I heard the crowd yelling, I knew when they tied it and then they were cheering again. I tried not to think about it. I got the two strikes and was really just trying to put the ball in play."

Down nine games in September, down seven runs in the eighth inning, down to two strikes with Johnson coming up.

How does that happen?

In my 50-plus years reporting Major League baseball, Tampa Bay's incredible September is near the top.

Of course, the Boston collapse made it possible for the Rays to complete their comeback.

Plus, the Yankees had already won their division and clinched home-field advantage through the AL Championship Series.

The Rays jumped on the underbelly of the Yankees' bullpen to wipe out the 7-0 deficit.

"The one thing I knew was that they were not going to use their other [top relievers] at the end -- Rafael Soriano, David Robinson, Mariano Rivera," said Maddon, referring to the fact the Yankees' basic goal was to prepare for their AL Division Series opener against Detroit on Friday. "You have to do what you think is right for your team on Friday. They had us beat; we came back."

Managers preach that games are 27 outs, but when a team is down, 7-0, after five innings, the outlook is bleak.

"It's really tough," said Longoria. "Personally, when I went up there and struck out against Phil Hughes [in the fifth], it seemed like everything was slipping away. Johnny Damon got it started [with a single] in the eighth inning, and we went from there. When you're so far down, it's tough to stay in it."

Girardi agreed: "There are teams that are in it until someone says you're not. The Rays won and won the Wild Card."

There were the six runs in the eighth and then Johnson's dramatic homer in the ninth.

"[Johnson pinch-hitting] was our last resort, pretty much at that moment, and he came through," said Maddon.

Johnson said: "At no point was I thinking, 'Oh, man. I have to hit that ball over the fence.' It just happened. I cannot describe the feeling. We're in the playoffs now. Three days ago, we knew what we had to do and came out and did it."

Longoria put it this way: "It was just a bunch of guys who put together an incredible season. Now, we don't have to be talking about how good it was, or how good it could have been if we got to the playoffs."

Now, it's off to Texas for the start of the new season. If memory serves, it was the Rangers who eliminated the Rays from the AL Division Series last year.

And no matter what happens in this best-of-five Octoberfest, it will be anticlimactic to September.