Hyun Soo Kim hit a pinch-hit two-run homer in the top of the ninth to lift Baltimore to a stunning 3-2 win at Toronto.
The win pushes the O’s (86-72) to within a game of the Blue Jays (87-71) in the AL wild-card race. The top two teams outside of the division winners meet in a one-game playoff to determine the fourth entrant in the league division series.
The Orioles are currently a game and a half ahead of Detroit and two up on Seattle with four games to go in the regular season.
Mark Trumbo hit his 46th homer of the season, a solo shot in the eighth, to get Baltimore on the board.
In the ninth, Jonathan Schoop reached base on a one-out single. He was lifted for pinch-runner Michael Bourn, who stole second with Kim at the plate, ahead of the go-ahead home run.
Zach Britton pitched a perfect ninth, striking out two, to notch his 47th save in as many opportunities.