TORONTO — Edwin Encarnacion hit a three-run homer in the 11th inning off Ubaldo Jimenez, and Toronto Blue Jays beat the Baltimore Orioles 5-2 in Tuesday night’s AL wild card game to advance to a Division Series matchup against Texas.

Jimenez relieved Brian Duensing with one out in the 11th, and Devon Travis singled in a 1-1 pitch. Reigning AL MVP Josh Donaldson singled on the next pitch, and Travis went all the way to third as left fielder Nolan Reimold bobbled the ball.

Encarnacion sent the following pitch, a 91 mph fastball, soaring into the second deck in left. Encarnacion immediately knew it was gone and raised both arms in triumph, index fingers pointed skyward.

Francisco Liriano retired five straight batters on four groundouts and a strikeout for the win after closer Roberto Osuna left with an injury.

Orioles closer Zach Britton, who was perfect in 47 save chances during the regular season, never got in the game as Orioles manager Buck Showalter saved him in case Baltimore took a lead in extra innings on the road.

Toronto opens the Division Series at Texas on Thursday. Last year, the Blue Jays beat the Rangers in five-game Division Series, sparked by Jose Bautista’s memorable bat flip following a tiebreaking, three-run homer in the seventh inning of Game 5. The teams brawled in May this year when Bautista was punched in the face by Rangers infielder Rougned Odor following a play at second base.

The roof was open at Rogers Centre, formerly SkyDome, where all 24 previous postseason games had been played with it closed.

Jose Bautista led off the second against Chris Tillman with his fifth postseason homer. Mark Trumbo, who led the major leagues with 47 home runs, gave Baltimore a 2-1 lead in the fourth with a two-run homer off Marcus Stroman.

Ezequiel Carrera’s RBI single chased Tillman in the fifth.