Brett Gardner of the New York Yankees hits an RBI single...

Brett Gardner of the New York Yankees hits an RBI single in the 10th inning against the Kansas City Royals at Kauffman Stadium on Aug. 9, 2021. Credit: Getty Images/Ed Zurga

KANSAS CITY, Mo. — It looked destined to be another one of those worst-losses-of-the-season candidates . . . until suddenly it wasn’t.

Despite blowing one-run leads in the seventh, eighth and ninth innings and a two-run lead in the 10th, the Yankees beat the Royals, 8-6, in 11 innings Monday night in front of 18,477 at Kauffman Stadium.

"A grind. But the definition of a team win,'' Luke Voit said. ''Everyone on the lineup card got the job done."

The game was scoreless through six innings — and then the teams combined to score in 10 straight half-innings from the seventh through the 11th.

Said Brett Gardner: "One of those games . . . you don’t see something like that very often. Just a crazy game to be a part of and fortunate for it to end up in our favor."

Kansas City became the first team since 1900 to erase a deficit in the seventh, eighth, ninth and 10th innings of a game, according to STATS.

Joey Gallo, who started the 11th at second per MLB’s extra-inning rules, scored on DJ LeMahieu’s double into the gap in right-center for a 6-5 lead. Two more runs scored with two outs when Gardner hit a 100.8-mph ground smash that took a nasty hop and hit shortstop Nicky Lopez in the face, and the two-run single proved to be the difference.

Wandy Peralta, activated last Thursday from the COVID-19 IL, at last did what the high-leverage Yankees relievers hadn't done: hold a lead. Par for the course on this weird night, it wasn’t easy. With two outs, Edward Olivares’ RBI single made it 8-6 and Hunter Dozier singled to bring the winning run to the plate in dangerous Carlos Santana, who hit a Baltimore chop to third. When Rougned Odor threw him out at first, the 4-hour, 52-minute game was over at 1:03 a.m. EDT.

The Yankees (62-50), who are 21-9 in their last 30 games, moved within two games of Oakland and Boston, who are tied for the wild-card lead.

Andrew Velazquez, the Bronx native who attended Fordham Prep and who was added to the major league roster Monday when Gleyber Torres was put on the injured list with a sprained left thumb, appeared as if he might end up as the winning run in the 10th.

Tyler Wade put up a tough nine-pitch at-bat against lefty Richard Lovelady, ending it with a single that put ghost runner Velazquez on third. Kyle Higashioka’s sacrifice fly to the warning track in center and Gardner’s RBI single made it 5-3.

But Clay Holmes walked Andrew Benintendi with one out in the bottom of the 10th, threw a wild pitch and allowed Jarrod Dyson’s sacrifice fly. Hanser Alberto’s two-out RBI single to right-center forced the 11th.

Voit’s two-out RBI single in the seventh broke a scoreless tie and his two-out homer in the ninth gave the Yankees a 3-2 lead.

"My job is to drive in runs,'' said Voit, who left five runners on base during two key at-bats Sunday. "I was pretty frustrated [Sunday]. [I’m a] middle-of-the-lineup guy; my job is to stack up the RBIs."

But Zack Britton walked Whit Merrifield with two outs in the bottom of the inning and Lopez’s single to left tied it at 3-3.

After Voit’s single gave the Yankees a 1-0 lead, Jonathan Loaisiga allowed the tying run in the bottom of the inning. He made a wild pickoff throw to first, allowing pinch runner Dyson to take second, and balked him to third, which led to Aaron Boone getting ejected by plate umpire Pat Hoberg. Ryan O’Hearn’s sacrifice fly tied it at 1-1.

Aaron Judge’s two-out RBI single in the eighth gave the Yankees a 2-1 lead — he cut down his swing on a 2-and-2 slider away and poked a liner into rightfield in a very un-Yankee-like instance of situational hitting — but the first two Royals reached against Loaisiga in the bottom half. Chad Green came on to face Santana, whose flyout to deep center moved Lopez to third. Benintendi's single to right tied it at 2-2.

The story until the flurry of offensive activity in the later innings was the starting pitching of both teams.

Jameson Taillon again was terrific, allowing one unearned run and four hits in six-plus innings-plus to lower his ERA to 1.96 in his last nine starts.

Royals righty Carlos Hernandez allowed one run and five hits in 6 2/3 innings.

The Yankees, who earlier in the day placed Torres on the injured list with a left thumb sprain — Boone estimated before the game that he will be out 10 to 20 days — finished with 11 hits to the Royals' 10.

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 5 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME