This was the great escape and it wasn’t entirely clear the New York Yankees deserved it.
But they will more than take it.
In a crazy night of baseball, which included a 59-minute rain delay that sent Masahiro Tanaka to the showers early, the Yankees topped the Royals, 5-4, in 10 innings at Kauffman Stadium.
The Yankees (68-63), who got a two-run homer from slumping rookie Aaron Judge in a three-run second inning, stayed 3{ games behind the Baltimore Orioles for the AL’s second wild-card spot.
The Royals (69-63), who left the bases loaded in the bottom of the 10th, lost for just the fifth time in their last 23 games.
The winning rally came in the 10th against Joakim Soria, who allowed back-to-back singles to Brian McCann and Chase Headley. Aaron Hicks pinch ran for McCann and went to third when Brett Gardner, who reached base five times, walked with two outs to load the bases. Jacoby Ellsbury then collected his fourth hit of the day, a bouncer back up the middle that deflected off Soria for a single that pushed Hicks across to make it 5-4.
With Dellin Betances having pitched the previous two innings, Joe Girardi brought on rookie righthander Ben Heller, one of four prospects acquired from the Indians in the Andrew Miller deal, for the 10th.
Heller hit the first batter he faced, Raul Mondesi, who stole second. Leadoff man Jarrod Dyson lined a single to center, putting runners on the corners for Lorenzo Cain.
The rightfielder struck out and, after Eric Hosmer was intentionally walked to load the bases, lefthander Chasen Shreve came on to face Kendrys Morales. Shreve, recalled earlier in the day, struck out Morales, then got Salvador Perez to fly to centre to end it.
Tanaka, 4-0 with a 1.63 ERA in his previous four starts, pitched reasonably well, allowing two runs and four hits in five innings.
But with the Yankees ahead 4-2 going into the top of the sixth, heavy rain caused a 59-minute delay and ended Tanaka’s night after 71 pitches.
After the delay, Royals manager Ned Yost brought on former Yankee Chien-Ming Wang, who escaped an immediate jam. Tyler Austin led off with a walk and Gardner, who reached base five times, doubled. Ellsbury struck out and Gary Sanchez sent a chopper to first for a forceout that could not get Austin in. Didi Gregorius flied to centre for the third out.
Dyson opened the bottom of the sixth against Adam Warren with an infield single and Cain battled for seven pitches, finally lining a full-count pitch opposite field down the line in right for an RBI double that made it 4-3.
In came lefty Tommy Layne to face Hosmer, whose groundout to first moved Cain to third. Layne hit the switch-hitting Morales with an 0-and-2 pitch and Girardi brought on righty Tyler Clippard, who allowed a rocket off the bat of Salvador Perez, a rocket hit right to Headley, who started a 5-4-3 double play, keeping the Yankees’ lead at 4-3.
After Clippard walked Cain to start the eighth, Betances came on to face Hosmer. Cain stole second and went to third when Sanchez’s throw skipped into the outfield for an error.

Results
Blue Jays     3     Orioles     5
Nationals     3     Phillies      2
Rays           4     Red Sox     3
Padres         3     Braves      7
White Sox     4     Tigers      8
Twins           4     Indians     5
Marlins         4     Mets         7
Pirates          0     Cubs        3
Mariners       7     Rangers     8
Cardinals      2     Brewers     1
Athletics       1     Astros        3
Yankees        5     Royals       4
Reds             2     Angels       4
Diamondbacks     4     Giants     3