Willy Adames singled home the winning run with two outs in the bottom of the 11th inning as the Tampa Bay Rays defeated the Boston Red Sox 5-4 on Friday in St. Petersburg, Fla.

Mitch Moreland hit a pair of two-run homers for the defending World Series champion Red Sox, who were eliminated from postseason contention earlier in the night when the Cleveland Indians beat the Philadelphia Phillies 5-2.

The Rays (91-63) remained tied with Cleveland for the American League's second and final wild-card playoff berth.

Moreland's second homer, with one out in the ninth inning off Rays closer Emilio Pagan, tied the score at 4-4. It was Moreland's 17th home run of the season.

The winning rally started with two outs in the 11th, as Michael Brosseau and Daniel Robertson each drew walks off Red Sox right-hander Trevor Kelley (0-3). Adames then lined a single to left field, with pinch runner Johnny Davis scoring from second base.

Rays right-hander Diego Castillo (4-8) pitched one inning for the victory.

The game was scoreless until the seventh, thanks to a pitching duel between Red Sox right-hander Rick Porcello and Rays right-hander Charlie Morton.

The Red Sox (80-73) broke the deadlock on Moreland's two-run homer to center field in the top of the seventh.

Boston's lead didn't last long.

With one out in the bottom of the inning, Travis d'Arnaud lined a single to center field off Red Sox reliever Darwinzon Hernandez. Pinch hitters Jesus Aguilar and Brosseau both walked, loading the bases.

That prompted a pitching change, with right-hander Marcus Walden replacing the left-handed Hernandez.

Pinch hitter Nate Lowe grounded into a forceout, third baseman Rafael Devers to shortstop Xander Bogaerts, to score a run.

Adames then hit a ground-rule double on a liner down the right field line, tying the score at 2-2 and sending Lowe to third base.

Left-hander Josh Taylor was called on to face Joey Wendle and threw a wild pitch, with Lowe scoring the go-ahead run.

The Rays tacked on a run in the eighth as Austin Meadows led off with a walk off right-hander Andrew Cashner and, an out later, Ji-Man Choi hit a run-scoring double to right.

Porcello pitched six scoreless innings. He allowed three hits, didn't walk a batter and struck out six.

Morton went 6 1/3 innings and allowed two runs on five hits. He walked one and struck out eight.