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 homer to cap a startling 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 ace Gerrit Cole's three-hitter in a 1-0 win on Saturday night.
But in a series in which 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, we knew something big was going to happen."
New York led 7-2 after a three-run homer 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 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 (3-5). Abraham Toro followed with an RBI double to make it 7-5, 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 percent 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."
Altuve was not available for a postgame interview. The Astros said his father was in the hospital and he rushed to be with him.
Boone was asked why he didn't go to slumping closer Aroldis Chapman in the ninth.
"I'm trying to get him into [positive] situations," he said. "It's critical we get him back to where we need to be. I want him to pitch those situations where he gets through with a clean outing under his belt."
Ralph Garza Jr. (1-2) pitched 1⅔ scoreless innings for the win. He allowed three walks on a day the Astros won despite walking a whopping 14 batters.
Maldonado homered in the Houston third off Jameson Taillon, making it 1-all and giving Houston its first run in the series.
Maldonado pulled his jersey down on the left side, revealing his bare chest as he rounded third base.
"It was a little hot," he said with a smile. "Trying to get some air inside my shirt."
The move came a day after Judge pulled his jersey together with both hands as he rounded third on a home run. It was a gesture that some interpreted as a reference to Altuve gripping his jersey to keep celebrating teammates from ripping it off after his winning homer in Game 6 of the 2019 AL Championship Series against the Yankees.
After Houston's sign-stealing scandal was uncovered, some speculated that Altuve didn't want his jersey pulled off because he was concealing a buzzer that helped in the plot. The allegation was never proven, and Altuve said he did it because he was shy and that he got in trouble with his wife when his jersey was ripped off before.
Altuve was not made available before Sunday's game to discuss Judge's display, but Baker weighed in on it Sunday.
"I noticed what he did," Baker said. "That was wrong."
Sanchez also pulled at his jersey very much like Judge did as he trotted home on his homer. He was greeted at the dugout steps by Rougned Odor, who draped him in a heavy Yankees coat -- perhaps a reference to Judge saying he did what he did because it gets "pretty chilly" at Minute Maid Park when the roof is closed.
Boone was in no mood to talk about all the back and forth between the players after the loss.
"I really don't have any interest," he said. "We coughed up a 7-2 lead. I don't think it had anything to do with the extra stuff people are talking about."
The Associated Press contributed to this report.