– Dallas Keuchel and the Houston Astros defied expectations all season long. Facing his biggest test yet, the bearded ace beat the odds and the Yankees once again.

Pitching on three days' rest for the first time in his career, Keuchel baffled New York for six innings of three-hit ball. Colby Rasmus and Carlos Gomez homered, and the Astros won 3-0 Tuesday night in the American League wild-card game.

The orange-clad Astros, who secured their spot in this winner-take-all game on the last day of the regular season, advanced to the AL Division Series. They will face the defending AL champion Royals, starting Thursday night in Kansas City.

"To come to Yankee Stadium and play that well was truly remarkable," said Keuchel, the AL's only 20-game winner.

Aggressive from the start in their initial playoff appearance as an American League club — and first since being swept by the White Sox in the 2005 World Series — the Astros came out swinging against Masahiro Tanaka in front of a revved-up Yankee Stadium crowd.

Rasmus sent Tanaka's first pitch of the second inning soaring into deep right field. Gomez, who only had five plate appearances after missing nearly two weeks because of a strained chest muscle in mid-September, connected on the first offering of the fourth.

"That really settled me down, and that's who we are," Keuchel said. "We hit a lot of home runs, pitch well and play defense."

AL hits leader Jose Altuve had an RBI single off All-Star reliever Dellin Betances in the seventh.

Reliever Tony Sipp walked one, and Will Harris and Luke Gregerson were each perfect for an inning to finish the three-hitter. The boos from the 50,113 stunned fans in the crowd grew with each out as Gregerson closed for a save.

The Astros raced to an area between first and second after Brian McCann grounded out to end it and jumped up and down in a big scrum. As he was coming off the field, Keuchel pumped his fists toward a group of cheering Astros supporters in orange shirts — and a few in big black beards — behind the visiting dugout.

It was a celebration a few years in the making. The Astros had averaged 104 losses in their previous four seasons.

"Now we get to go to Kansas City. It's going to be some grind-it-out baseball," Rasmus said. "We have to come in there the way we came in tonight. It's going to be fun."

The Yankees lost six of seven to close the regular season. And despite all the talk of a playoff reset, they went bust against a new nemesis in their first — and only — postseason game of the post-Derek Jeter era.

"Just didn't get it done," manager Joe Girardi said.