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 the Yankees for six innings of three-hit ball, Colby Rasmus and Carlos Gomez homered, and the Astros blanked New York 3-0 on 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, now advance 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 first playoff appearance as an American League club and for the first time 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 had only five plate appearances after missing nearly two weeks with a strained chest muscled in mid-September, connected on the first offering of the fourth.

American League 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 as a group of cheering Astros supporters in orange shirts behind the visiting dugout.

It was a celebration a few years in the making -- the Astros have averaged 104 losses in their last four seasons.

In a matchup of two teams that surprised many by building big division leads before wasting them late, the upstart Astros, just two years removed from an 111-loss season, looked the more comfortable team in the October limelight.

The Yankees limped into their first postseason since 2012, losing six of seven and, despite all the talk of a postseason reset for the struggling lineup, New York 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.

Fans taunted the 27-year-old Keuchel the moment he walked to the outfield for warmups. Then he toyed with the Yankees from the first batter, striking out Brett Gardner looking.

Gardner, Brian McCann, Chris Young and Girardi all had words with plate umpire Eric Cooper as Keuchel cruised through New York's lineup for the third time this season.

The AL Cy Young Award contender held the Yankees scoreless for 16 innings in two regular-season starts. On this much bigger stage, the lefty was just as confounding, dropping his slider and two-seam fastball seemingly wherever he wanted in striking out seven as nearly all his teammates and coaches stood along the dugout railing for every pitch.

When he gave up two singles in the sixth -- bringing the crowd to its feet with Alex Rodriguez stepping into the batter's box -- manager A.J. Hinch took a walk to the mound to give Keuchel a breather. Keuchel responded by getting A-Rod to fly out lazily to center field for his final out.

Keuchel is the first starter with a scoreless postseason start on three days' rest since Josh Beckett shut out the Yankees in the 2003 World Series.

Tanaka struggled with the long ball all season, giving up 25 homers in 24 starts this year. He only allowed two more hits in five innings but matched a season high with three walks. He struck out three.

TRAINER'S ROOM

Astros: Jed Lowrie pinch hit in the ninth for Gomez, who looked as if he tweaked his injury while batting in the sixth.

UP NEXT

Hinch will set his rotation for the division series. Houston went 4-2 against the Royals this season.