HOUSTON -- Thousands of fans left Minute Maid Park with replica No. 27 Jose Altuve jerseys from a giveaway on Sunday.
The Houston Astros star didn't make it off the field with his.
Altuve hit a three-run home run to cap a six-run rally in the bottom of the ninth inning, getting his shirt yanked off in a frenzied celebration and lifting the Astros over the New York Yankees 8-7.
"It was a miracle," Manager Dusty Baker said.
The Astros had been shut out by the Yankees the previous two games, highlighted by Gerrit Cole's three-hitter in a 4-0 win on Saturday night.
But in a series where the teams took turns trolling each other after lingering ill will over the years -- including Yankees star Aaron Judge seeming to mock Altuve -- the Astros and their dynamic second baseman had the final say.
"It was pretty amazing how Altuve did it again," catcher Martin Maldonado said. "He's a guy with a big heart and is the face of this team. He got to the plate and we knew something big was going to happen."
Big-league teams are 493-2 this season with a lead of at least four runs going to the ninth -- the Yankees wasted an 8-4 advantage in an 11-8 defeat to the Los Angeles Angels on June 30, making this the first season the Yankees twice lost games when leading by four runs entering the ninth.
New York led 7-2 after a three-run home run by Gary Sanchez in the eighth inning and was poised for a sweep before the Astros broke loose and dealt the Yankees another aching last-inning loss.
"It's the ultimate gut punch," Manager Aaron Boone said. "You've got a five-run lead in the ninth against a great team with a chance to earn the sweep and they come back to win. We've got some things to get better at and make sure all hands are where they need to be."
It was the first time the Astros won after trailing by five or more runs in the ninth inning since also being down 7-2 before rallying to beat the Montreal Expos 9-8 on July 25, 1980, according to information provided by the Astros from the Elias Sports Bureau.
After the first two Astros reached base against Domingo German in the ninth, Chas McCormick hit a two-run double off Chad Green. Abraham Toro followed with an RBI double to make it 7-5, still with no outs.
Pinch-hitter Jason Castro singled and one out later, Altuve launched his soaring shot to left field. His teammates greeted him at the plate and ripped off his jersey in the celebration, leaving him shirtless as he hugged Baker on his way off the field.
"It was 100% coming off after that home run," McCormick said of Altuve's jersey.
Added Baker: "That was the most wonderful thing I've seen in years."
WHITE SOX 7, ORIOLES 5 (10) Adam Engel hit a three-run home run in the 10th inning and Chicago completed a season sweep of Baltimore.
BLUE JAYS 3, RAYS 1 Danny Jansen homered, Robbie Ray took a no-hitter into the seventh inning and Toronto ended Tampa Bay's six-game winning streak.
ATHLETICS 4, RANGERS 1 Matt Olson hit two of Oakland's four home runs and Chris Bassitt allowed one run in seven innings in a win over Texas.
TWINS 12, TIGERS 9 (10) Jorge Polanco hit a game-ending three-run homer in the 10th inning, and Minnesota completed a four-game sweep of Detroit.
ANGELS 7, MARINERS 1 David Fletcher had four hits and four RBI to extend his hitting streak to 24 games, and Los Angeles beat Seattle.
MARLINS 7, BRAVES 4 Pablo Lopez set a major-league record by striking out the first nine batters to start a game, pitching Miami past Atlanta. The 25-year-old Lopez broke the mark of eight consecutive strikeouts to begin a game set by Jim Deshaies in 1986, and matched by Jacob deGrom in 2014 and German Marquez in 2018.
REDS 3, BREWERS 1 Nick Castellanos hit a tiebreaking two-run single off All-Star closer Josh Hader with two outs in the ninth inning, and Cincinnati beat Milwaukee.
PIRATES 6, METS 5 Wilmer Difo's tiebreaking single in the ninth inning capped Pittsburgh's rally from a five-run deficit to beat New York.
GIANTS 3, NATIONALS 1 Kevin Gausman worked six-plus innings of one-run ball and Curt Casali hit a three-run home run as San Francisco completed a three-game sweep of Washington.
DODGERS 7, DIAMONDBACKS 4 Max Muncy slugged a three-run, walk-off home run in the ninth inning, rallying Los Angeles past Arizona.
ROCKIES 3, PADRES 1 Pinch-hitter Chris Owings hit a go-ahead home run in the seventh inning as Colorado beat San Diego.
PHILLIES 5, RED SOX 4 Ronald Torreyes hit a three-run home run and Philadelphia used six pitchers to beat Boston.