NEW YORK -- The Yankees are back in the postseason, though not the way they wanted.
Aaron Hicks doubled home the winning run in the 11th inning, and New York clinched an AL wild card with a 3-2 win over the Baltimore Orioles on Saturday.
Rookie manager Aaron Boone will lead the Yankees into the winner-take-all Oct. 3 wild-card game, most likely against Oakland. The Yankees began the day 1 games ahead of the Athletics for home-field advantage and are 53-27 at home this season.
Hicks and Luke Voit homered in the second inning, but the Orioles tied the score with runs in the third and the fifth off Lance Lynn.
Tampa Bay, third in the wild-card chase, lost at Toronto as the ninth inning was about to start in the Bronx. The Yankees finally broke through after Didi Gregorius singled off Paul Fry (0-1) starting the 11th.
Giancarlo Stanton struck out. Hicks fouled a pitch off his left foot, then took a ball. He lined a low, inside slider down the left-field line, and Gregorius sped home, sliding in headfirst ahead of shortstop Jonathan Villar's relay throw. Gregorius spread his arms wide, and the Yankees poured out of the dugout to celebrate.
New York sprinted to a 54-27 record at this season's halfway point and was ahead of Boston by percentage points in the quest for its first AL East title since 2012, but the Yankees slowed in the second half as Aaron Judge, Gary Sanchez, Gregorius and Aroldis Chapman got hurt. The Red Sox clinched their third straight division crown by beating New York on Thursday.
Still, at 95-59 the Yankees matched their most wins since 2012 and equaled their season high of 36 games over .500. They will make their 54th postseason appearance - 21 more than any other team.
Boone replaced Joe Girardi after the Yankees, led by a rebuilt roster filled with youth, reached last year's AL Championship Series but lost to Houston in seven games.
New York's bullpen, which has struggled at times, showed its strength.
Chapman, in his second outing since returning from the disabled list, struck out two in a perfect seventh inning - his earliest appearance in a game since Aug. 24 last year. Dellin Betances fanned three straight batters in the eighth, and Zach Britton struck out two more in a one-hit ninth.
Jonathan Holder allowed DJ Stewart's double on his first pitch in the 10th but escaped. Baltimore had second and third with no outs when Adam Jones grounded to third with the infield in. After an intentional walk, Chris Davis lined out to a diving Voit at first and Breyvic Valera popped out.
Tommy Kahnle (2-0) pitched a one-hit 11th.
Baltimore dropped to 44-110, one shy of the franchise record for losses set by the 1939 St. Louis Browns. The Orioles entered 60 games out of first place.
Hicks and Voit connected in the second off David Hess, raising the Yankees' team-record home run total to 251. Voit's drive hit the Toyota sign above New York's bullpen in right-center and gave him 11 homers and 25 RBIs in 32 games since he was acquired from St. Louis.
Cedric Mullins' tapper in front of the plate drove in a run in the third, and DJ Stevens singled in the tying run in the fifth.
Baltimore's Steve Wilkerson was thrown out at the plate twice, by Gleyber Torres after the second baseman retrieved Sanchez's errant throw and by Judge on Caleb Joseph's single to right in the fifth. Wilkerson threw out Torres trying to score from third on Andrew McCutchen's seventh-inning grounder to third.
Lynn struggled and failed to pitch a 1-2-3 inning. He allowed two runs - one earned - in five innings but got a key out in the fifth when Adam Jones bounced into an inning-ending forceout with the bases loaded. Jones is 2 for 15 against Lynn.
Hess gave up two runs in five innings and is 1-9 in his last 15 starts.
* Follow us on YouTube
* More local news
* Send us a news tip
* Download the abc7NY app for breaking news alerts
Yankees clinch playoff spot, earn AL wild card after walk-off win over Orioles