ST. PETERSBURG -- The longest game in Rays and Orioles history refused to end as Friday night stretched into Saturday morning at Tropicana Field.
Eventually, six hours, 54 minutes, 18 innings, 26 hits, an MLB-record 21 pitchers and 593 pitches later, Tampa Bay walked off with a 5-4 win that put the Rays in the driver's seat of the American League Wild Card race.
David DeJesus' single to right field in the bottom of the 18th inning Saturday morning put an end to the marathon at 2:05 a.m. ET.
DeJesus' helmet went flying -- eventually connecting with Kelly Johnson's back -- but somehow, it didn't hurt. DeJesus' teammates, all but three of whom appeared in the game, had no problem finding enough energy to mob him.
They tried rally caps in the 17th to no avail. Masks came out in the 18th, with guest appearances by Luke Scott disguised as Chewbacca and Jamey Wright as Gene Simmons. Maracas, James Loney's saxophone and the buffet spread from the clubhouse were on their way if a 19th inning was in store.
"We pulled out all the characters," said DeJesus, who was 4-for-8. "We had a lot of stuff going on, but to pull out a win in this type of game, atmosphere, length, it's a great win for us. Hopefully we can keep the momentum going later on today."
It's one thing to win an 18-inning game in April. It's another to do it in the heat of a playoff push. The Red Sox had clinched the AL East hours earlier and the Indians' seven-inning win over the Astros had them breathing down the Rays' necks. The Indians moved into the second Wild Card position, a half-game behind the Rays.
"That is the hunt for October," catcher Chris Gimenez said. "That's everything you play 162 games for. That win means a lot for us. I've never been a part of a game that long. To win it the way we did, I hope we can run with it. It couldn't have happened at a better time. It's a huge boost for us."
DeJesus' hit ended a drought of 10 scoreless innings and was set up by Desmond Jennings' one-out double in the 18th. Jennings was originally a late scratch from the lineup because of neck stiffness.
He loosened up in time to enter as a pinch-hitter in the ninth inning and still went 2-for-4.
"That was fun, man," Jennings said. "To be on the winning side of a game like that is awesome. For two teams to go out and play as hard as we did for two hours, that's probably the best win of the year for us."
Tampa Bay's ace David Price left after five innings, and manager Joe Maddon was running out of options in the bullpen. He turned to Jeremy Hellickson, who was scheduled to start Sunday, in the last 2 1/3 innings of relief.
Hellickson picked up the win and allowed just one hit.
"That was the craziest seven hours of my life," Hellickson said. "I would have went as long as possible. I'll throw as many pitches as I needed to before a position player went out there."
Baltimore's bullpen was also impressive, as nine pitchers followed starter Jason Hammel and allowed just eight hits. It wasn't quite enough for the Orioles, however, who now find themselves 2 1/2 games behind the Indians.
"It was impressive," O's manager Buck Showalter said. "Two teams wanting something very badly and a small margin, and that's why those games go on like that."
Maddon often references the need for his club to create an "organic moment" in order to spark a run into October.
They thought they had it Wednesday night when Jennings hit a walk-off single in the 12th inning against the Rangers. It didn't carry over, though, as the Rangers hung a six-run loss on them Thursday.
This one, all 18 innings of it, might be different.
"There is so much energy at stake regarding winning," Maddon said. "You have to find energy after you lose that game. It's an incredible boost. [Saturday] will tell the tale."
Baltimore and Tampa Bay will meet again for a day game just over 11 hours after DeJesus' hit landed softly in right field.
Sam Strong is an associate reporter for MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.