ST. PETERSBURG, Fla. (AP) — Aaron Judge went from being a late scratch to hitting a tiebreaking single in a two-run 10th inning as the New York Yankees beat the Tampa Bay Rays for the second straight day, 3-1 on Wednesday night.

Judge was taken out of the lineup about 30 minutes before the first pitch, and initially no announcement was made about why. The All-Star right fielder struck out in the fifth pinch-hitting for Estevan Florial.

Judge returned to the team Tuesday after going on the COVID-19 injured list July 16. After the game Wednesday night, Yankees manager Aaron Boone explained why Judge was scratched, saying he had doctor appointments related to his return from the IL and didn't arrive at the ballpark until less than an hour before the start.

“Better late than never," Judge said.

Judge said he had mild virus symptoms, including headaches and sniffles, but was able to work out during his IL stint.

“I'm feeling great,” he said. “The most important thing is your health and making sure you're 100%.”

Judge declined to say if he has been vaccinated for COVID-19.

“I'm not going to get into that," he said. “It's something I'd like to keep with, talking to my doctor about."

New York also had a big night off the field. The Yankees reached a deal to get All-Star slugger Joey Gallo from the Texas Rangers, a person familiar with the trade told The Associated Press.

The person spoke on condition of anonymity because the move had not yet been announced and was subject to approval of medical records of the players involved.

The Yankees are 8 1/2 games behind first-place Boston in the AL East and trail Tampa Bay, Oakland and Seattle in the race for two wild cards.

Greg Allen was hit by a pitch from Pete Fairbanks (3-4) leading off the 10th, putting runners on first and second. Judge then grounded an RBI single to center field that just got by shortstop Wander Franco.

Fairbanks left with a shoulder issue and was replaced by Andrew Kittredge, who threw a wild pitch that allowed another run to score as the Yankees went up 3-1.

“It was a grind all game.” Boone said. “Really good winning at-bats there in the end,”

Chad Green (4-5) pitched a perfect inning before Aroldis Chapman worked the 10th to get his 20th save in 24 chances. Four relievers combined for five hitless innings to complete a three-hitter for the Yankees.

Randy Arozarena drew a one-out walk from Chapman. Pinch-hitter Nelson Cruz struck out after Yandy Díaz and Arozarena both advanced on a wild pitch.

“We always feel good anytime Nelson's got a bat in his hand and there's guys on base,” Rays manager Kevin Cash said. “You're going against one of the game's best in Chapman. That's how it goes sometimes."

The game ended when first baseman DJ LeMahieu made a stumbling grab on Francisco Mejía's infield popup.

“Adventure. That's probably a good word for it,” LeMahieu said.

Franco had a leadoff infield single in the fourth and scored to put the Rays up 1-0 on Brandon Lowe’s two-out double off Nestor Cortes.

LeMahieu tied it with a fifth-inning sacrifice fly against Michael Wacha.

Cortes and Wacha both allowed one run and three hits in five innings. Wacha struck out nine, while Cortes whiffed five.

NOT JUST YET

Boone is leaning toward having DH Giancarlo Stanton possibly make his first appearance in left field this season not against the Rays but during the upcoming weekend interleague series at Miami.

NUMBERS

The Rays have been held to one run or fewer 18 times. ... Tampa Bay is 5-10 in extra innings, including losing seven of the last nine.

TRAINER’S ROOM

Yankees: OF Clint Frazier (vertigo) continues to undergo neurological tests in Michigan and will have his status evaluated by the team's medical staff this weekend. … RHP Luis Severino (Tommy John surgery) is set to pitch in a simulated game Thursday.

Rays: Cruz was scratched from the starting lineup due to a bruised foot. ... RHP Chris Archer (right forearm strain) is scheduled to make his next rehab start Sunday. He could be ready to join the rotation in a couple of weeks.

UP NEXT

Yankees ace Gerrit Cole (10-5) and Tampa Bay RHP Luis Patiño (1-2) are the scheduled starters for the series finale Thursday. Cole is 1-5 with a 3.82 ERA in 10 regular-season starts against the Rays.

___

AP Baseball Writers Stephen Hawkins and Ronald Blum contributed to this report.

___

More AP MLB: https://apnews.com/hub/MLB and https://twitter.com/AP_Sports