The Associated Press

NEW YORK — Travis d’Arnaud was down to his last strike. And so were the Tampa Bay Rays, trailing by two runs with two on and two outs in the ninth inning against All-Star closer Aroldis Chapman.

D’Arnaud hacked at the next pitch, fouling off a 100 mph heater. Then another. After two tempting balls in the dirt, he faced a full count.

Chapman came back with a slider high and away — and d’Arnaud sent it high and away.

The catcher hit his third home run of the game, a go-ahead drive that sailed over leaping right fielder Aaron Judge for a startling shot that helped the Rays overcome their Yankee Stadium woes to beat New York 5-4 on Monday night.

“Coolest night ever,” d’Arnaud said.

D’Arnaud’s three-run homer kept drifting, landing just one or two rows deep beyond the short right field porch. Several teammates spilled from the dugout to congratulate d’Arnaud while a crowd of 43,173 fell silent.

“Trav just put the team on his back,” Rays starter Blake Snell said.

The 30-year-old backstop tied a Tampa Ray record for homers in a game. It has been done five times, most recently by Evan Longoria in 2012.

The Yankees had been 49-0 this season when leading after eight innings. The Rays won for just the second time in seven games in the Bronx this year and cut New York’s lead in the AL East to five games.

“It’s a little difficult, you know, when you don’t think he gets it all, ends up getting the homer, but that’s the way the game is,” Chapman said through a translator.

D’Arnaud has had a tumultuous season, having been released by the Mets, signed by the Dodgers and traded to the Rays five days later.

But on this night, none of that mattered as he became the first catcher to hit three homers in a game against the Yankees.

Also Monday:

Dodgers 16, Phillies 2: PHILADELPHIA — Cody Bellinger hit his 32nd and 33rd homers, Clayton Kershaw struck out seven in six innings and major league-leading Los Angeles routed Philadelphia. Bellinger passed reigning NL MVP Christian Yelich for the MLB lead in homers.

Giants 19-2, Rockies 2-1: DENVER — Brandon Crawford homered three times and drove in nine runs in two games as San Francisco swept Colorado in a day-night doubleheader.

Braves 4, Brewers 2: MILWAUKEE — Freddie Freeman hit a three-run shot, his 25th home run of the season, and Max Fried pitched five scoreless innings as Atlanta beat Milwaukee. The Braves won their fifth straight and moved a season-best 21 games over .500.

Red Sox 10, Blue Jays 8: BOSTON — Rookie Michael Chavis hit his first grand slam, Xander Bogaerts had three hits and Andrew Benintendi drove in three runs as Boston beat Toronto.

Indians 8, Tigers 6: CLEVELAND — Oscar Mercado hit his second home run of the game — a leadoff blast in the seventh inning — and Cleveland beat Detroit.

Reds 6, Cubs 3: CHICAGO — Eugenio Suarez and Yasiel Puig each hit his 22nd home run of the season, and Cincinnati rallied past Chicago.

Royals 5, White Sox 2: KANSAS CITY, Mo. — Jakob Junis struck out a career-high 10 and Nicky Lopez drove in a pair of runs and scored twice as Kansas City beat Chicago.

Cardinals 7, Pirates 0: ST. LOUIS — Miles Mikolas pitched a complete-game eight-hitter and Tyler O’Neill hit a pair of two-run homers, leading St. Louis over Pittsburgh.

Angels 9, Astros 6: ANAHEIM, Calif. — In their first game without star Mike Trout, who is out with a calf strain, the Angels withstood a rough outing from starting pitcher Griffin Canning and a big night from Astros outfielder George Springer for the win. Albert Pujols went 3-for-4 with three RBIs and two runs scored, and Andrelton Simmons homered to lead the Angels.