Papelbon (4-1) struck out the first two batters before giving up a double to Chris Davis. Nolan Reimold followed with a double to score pinch-runner Kyle Hudson, and Andino completed the comeback with a single to left that a sliding Carl Crawford couldn't glove.

"To walk off, everybody wants to walk off," Andino said. "It's priceless man, you don't have any words for it. Just enjoy it, and there's no tomorrow, so next year."

The same can be said for the Red Sox.

Baltimore finished 69-93, but went 5-2 against Boston down the stretch.

"It was exciting. We battled to the end and we came out on top this time," Reimold said. "We weren't playing for the playoffs, but we were playing for pride, and we showed it tonight."

Boston held a nine-game lead in the AL wild-card race after Sept. 3, but a 7-19 September swoon left them tied with Tampa Bay entering the final day of the regular season.

Only minutes after this game ended, the Rays completed their comeback from a 7-0 deficit with an 8-7 win over the New York Yankees in 12 innings.

Boston became the first team to miss the postseason after leading by as many as nine games for a playoff spot entering September, according to the Elias Sports Bureau.

"We'll go down in history as one of the worst collapses in history, so it definitely doesn't feel good to be part of that," Crawford said. "We had high expectations, and to fall short the way we did is definitely disappointing for us."

Boston's 7-20 record for the month is its worst September since an identical mark in 1952.

"It's just shocking. We should be playing a one-game playoff right now," starter Jon Lester said. "It's just one of those things. It wasn't meant to be. It wasn't our year."

Even if Tampa Bay lost, the Red Sox faced the prospect of a quick turnaround following a long night at Camden Yards that included a rain delay of 1 hour, 26 minutes in the middle of the seventh inning.

When the rain came, Tampa Bay trailed 7-0. By the time play resumed, the Rays and Yankees were tied at 7 heading into the 10th inning.

Dustin Pedroia homered for the Red Sox, who went through the entire month of September without winning consecutive games.

Pitching on three days' rest, Lester limited the last-place Orioles to two runs and four hits over six gritty innings. But it wasn't enough to prevent the Red Sox from absorbing one final blow.