DETROIT -- Chris Davis homered in the 12th inning and again in the 13th, and the Baltimore Orioles finally held on after the second one, outlasting the Detroit Tigers 13-11 on Tuesday night.
Davis led off the 12th with a home run that started a three-run inning for the Orioles, but Detroit rallied with three of its own in the bottom half to keep the game going. Davis came up again with a runner on third in the 13th and hit a two-run shot off Francisco Rodriguez (1-5) that gave Baltimore the lead for good.
The Orioles led 7-1 after scoring seven runs in the third, but they squandered that big advantage and needed Mark Trumbo's solo shot with two outs in the ninth just to force extra innings. Baltimore snapped a four-game losing streak.
Richard Bleier (1-1) earned his first career win.
J.D. Martinez homered twice for the Tigers, including a grand slam that put them up 8-7 in the seventh. Victor Martinez also went deep for Detroit, which was one out from a remarkable victory when Trumbo connected off Justin Wilson.
The Tigers had the bases loaded with two outs in the 11th and 12th, but with the winning run 90 feet away, Tyler Collins lined out to right in the 11th and grounded out to second in the 12th. Collins is mired in an 0-for-30 slump, and Detroit didn't have any position players left to pinch hit.
After Davis put the Orioles up 9-8 in the 12th, they added two more runs and appeared to have a safe lead, but the Tigers tied it with RBI singles by Ian Kinsler, Miguel Cabrera and Alex Avila.
Detroit led 1-0 in the third when J.J. Hardy started Baltimore's barrage with a solo homer. Manny Machado and Davis hit RBI doubles, and Welington Castillo added a two-run single to make it 5-1. The Orioles sent 11 batters to the plate in the inning.
Detroit starter Matthew Boyd allowed seven runs and eight hits in 2 1/3 innings. Baltimore's Wade Miley permitted four runs and eight hits in five-plus innings.
Both teams used six relievers in a game that lasted 5 hours, 19 minutes.
RELATED: Latest 2017 MLB Power Rankings