OAKLAND, Calif. — When he got to second base, Yandy Diaz stole a glance back toward the dugout and saw all his teammates going crazy. He gleefully kept running.

Out for two months, no matter.

Diaz slugged baseball's lowest spender into a playoff matchup with mighty Houston, Charlie Morton silenced the powerful Athletics on the mound, and the Tampa Bay Rays beat Oakland at its own game with a 5-1 win in the AL wild-card round Wednesday night.

WASHINGTON NATIONALS PLAY THROUGH TECH GLITCHES AT NL WILD CARD GAME TO BEAT MILWAUKEE BREWERS

After playing only one game since late July because of a foot injury, Diaz hit a leadoff homer and went deep again in the third inning.

“When I looked to the bench and saw the guys super excited, it pumped me up to go around the bases,” Diaz said through a translator. “I thought we had to carry that momentum throughout the game.”

Avisail Garcia hit a two-run drive in the second, and Morton had all the support he needed as Tampa Bay advanced to face the AL West champion Astros in a best-of-five Division Series.

Game 1 is Friday at Houston, which piled up a major league-best 107 wins this season.

“We have a tough road ahead of us, Houston’s a great team, but we played them well this year. It’s going to be a dogfight,” Tommy Pham said.

Pham homered in the fifth for the 96-win Rays, who had the smallest payroll in the majors at $66.4 million. And in a playoff meeting between creative, small-budget teams that make the most of limited resources, it was Tampa Bay that came out on top.

The Rays were unfazed by a towel-swirling Oakland crowd of 54,005 that established a wild-card record, having recently played at Dodger Stadium and on the road against the Yankees and Red Sox during the season's final two weeks.

“I really feed off the energy of this situation. I that helped us,” Morton said. “It helped us to come in here and be in a high-pressure situation. The stadium was pretty rowdy but I think that helped us focus.”

And when Marcus Semien struck out to end it, Tampa Bay players raced out of their dugout to celebrate and put on fresh playoff T-shirts and caps. Once in the clubhouse, the Rays drenched Morton with booze.

"It's a beautiful thing having the lowest payroll in baseball and having the success we did," center fielder Kevin Kiermaier said before the game. "It always feels good to stick it to the man any time you're able to in this game, and that's something to be very proud of."

The A's have lost nine straight winner-take-all games since 2000, going 1-15 with a chance to advance to the next postseason round. Their only win came in 2006 against the Twins before being swept in the AL Championship Series by the Tigers.

A year ago in the wild-card game, Oakland's first time back in the playoffs since 2014, the A's fell behind fast and lost 7-2 at Yankee Stadium. They won 97 games again to earn a wild card.

This game had a far different feel in the familiar, friendly confines of the Coliseum, but the A's dug themselves another quick hole.

And the visitors were the ones putting on a happy home run show this time. Oakland, which hit a franchise-record 257 homers, is 0-6 in winner-take-all playoff games at home since 2000.

Even a day earlier, Rays manager Kevin Cash wasn't sure Diaz would play given how much time he missed during the season’s second half.

Diaz returned for the finale last Sunday at Toronto after being sidelined since July 23. He played in just 79 games this season, 22 of those at first base with 17 starts.

"He probably caught us off guard a little bit with how quickly he turned around over the last five, six days," Cash said.

DAVID ROSS ON LIST OF POSSIBLE CANDIDATES FOR CUBS MANAGER

Never one to shy from the unorthodox _ the Rays used four outfielders against Matt Olson _ Cash started Diaz at first to make sure his best bat against lefties was in the lineup.

Kiermaier noted Diaz is "just one of those guys, he just wakes up out of bed and rakes. Everyone knows him for his muscles and what he can do in the weight room and stuff like that, but the guy finds the barrel so much throughout this whole season, and any time we're able to have him available, we're happy."

Morton, with a career-high 16 wins and his best ERA yet of 3.05 this season, counted on his playoff experience giving him an edge. He won Game 7 of the ALCS and World Series for the Astros in 2017.

Morton gave up five hits without an earned run over five innings. He struck out four and walked three in his seventh postseason start and eighth appearance, having spent the last two seasons with Houston.

The right-hander walked Mark Canha to load the bases with two outs in the first before retiring Jurickson Profar on a flyball and had already thrown 32 pitches.

Morton quickly settled in and once his turn was done, the Rays’ shutdown bullpen did the rest.

“When the first inning ended, I kind of said to myself, we were fortunate to have Charlie Morton on the mound. We get the 1-0 lead. A young pitcher in that situation, that environment, you just wonder how he's going to be able to handle that,” Cash said. “But Charlie, been there, done that, his veteran, his experience, I think allowed that. And I would still say, I don't think Charlie was at his best today, but he certainly made his best pitches when they counted the most.”

CLICK HERE FOR THE ALL-NEW FOXBUSINESS.COM

Semien reached third on a three-base error by third baseman Mike Brosseau in the third and scored on Ramon Laureano's sacrifice fly. Oakland did little else.

Diaz hit the fifth pitch of the night from Sean Manaea over the wall in right-center. Manaea then struck out the side after Diaz's drive, but was done after two innings.

“That’s kind of our game. They kind of beat us with our game. We’re normally a home run-hitting team,” Oakland manager Bob Melvin said.

Melvin handed Manaea the ball based on his triumphant September return after missing nearly a year following shoulder surgery. Manaea went 4-0 with 1.21 ERA in five starts last month.

Manaea earned his first career playoff start over 15-game winner Mike Fiers, who pitched a no-hitter May 7 against the Reds to begin a 21-start unbeaten stretch in which he went 12-0.

“That’s the tough part about a one-game playoff. Those nights where it’s not happening are going to be your last game,” Semien said. “That’s what happened.”