BALTIMORE (AP) -- Chris Davis homered on a 3-0 pitch from Matt Andriese leading off the 11th inning, and the Baltimore Orioles snapped a six-game losing streak with a 7-6 victory over the Tampa Bay Rays on Wednesday night.
It was the second homer of the game for Davis, who has 38 for the season.
Down 6-4 in the ninth, Baltimore appeared doomed to its 13th loss in 14 games. Looking for his 34th save, Brad Boxberger walked Matt Wieters before Jonathan Schoop hit a 1-1 pitch over the wall in left.
Baltimore was 0-61 when trailing after eight innings.
In the 11th, Andriese (3-5) missed on three straight pitches before throwing one down the middle that Davis hit deep into center field.
Brad Brach (5-2) pitched two hitless innings for the Orioles, who averted a three-game sweep.
Evan Longoria hit two home runs and J.P. Arencibia had a solo shot for the Rays, who are 2-11 in extra innings.
Tampa Bay went up 5-4 in the sixth when Arencibia and Grady Sizemore hit successive doubles off rookie Mychal Givens.
Longoria added a bases-empty drive off Darren O'Day in the ninth. It was his second multihomer game of the season and 15th of his career.
But Boxberger couldn't hold the lead, and Tampa Bay's modest three-game winning streak ended.
Although the scoring didn't begin until the third inning, there was plenty of excitement early. Steve Pearce robbed Brandon Guyer of a first-inning homer with a leaping catch at the wall in left, and Adam Jones threw out Logan Forsythe trying to score on a single to center in the second.
Tampa Bay went up 4-0 in the third, the key blows a solo shot by Arencibia and a two-run drive by Longoria, his 200th home run. It was the second homer in two games for Arencibia, who didn't have any this season before Tuesday night.
Baltimore pulled even in the bottom half. Manny Machado hit an RBI single and scored on a double by Gerardo Parra before Davis capped the uprising with a two-run drive to center.
The four runs were more than the Orioles scored in each of their previous six games.
Rays: OF Steven Souza Jr. (left hand fracture) will take batting practice with the team for a few days, then go on a short rehabilitation stint with Triple-A Durham before possibly rejoining the team, manager Kevin Cash said. ... CF Kevin Kiermaier returned after missing Tuesday's game with a right ankle sprain.
Orioles: RHP Miguel Gonzalez will miss time with shoulder inflammation and tendinitis, but said he was "excited" that an MRI showed no structural damage.
Rays: After taking Thursday off, the Rays send Jake Odorizzi to the mound Friday night to start a three-game series at Yankee Stadium.
Orioles: Baltimore gets Thursday off before launching a three-game series in Toronto on Friday night.