Aroldis Chapman had little control before the delay and Kirby Yates demonstrated even less after it.

And so a somewhat surreal night of baseball — one that bled well into Tuesday morning — concluded with the Yankees taking a 9-6 loss to the Rangers in front of 32,914 at the Stadium.

About 50 of those fans were left to watch Yates’ implosion when play resumed at 2:15 a.m. Tuesday after a 3-hour, 35-minute rain delay.

The righthander, who came on with one on and none out in the ninth and the Yankees leading 6-5, hit three batters in the inning and allowed two-run singles by Adrian Beltre and Elvis Andrus as the Rangers extended the AL’s best record to 50-27.

In the bottom of the ninth, righthander Sam Dyson allowed an infield single by Starlin Castro and a one-out walk to Chase Headley, bringing Aaron Hicks to the plate as the tying run. But Hicks grounded into a forceout at second and Jacoby Ellsbury lined to left to end it at 2:44 a.m. as Dyson picked up his 16th save.

Yates, who entered the game with a runner on first and a 3-and-1 count on Shin-Soo Choo, struck out Choo looking but hit Ian Desmond in the back and Nomar Mazara in the left ankle, each time on a 1-and-2 pitch, to load the bases. He then got ahead of Beltre 0-and-2, but on yet another fateful 1-and-2 pitch, he allowed a two-run single to left.

Yates hit Prince Fielder in the right elbow with an 0-and-2 pitch to reload the bases, got ahead of Roughned Odor 0-and-2, threw three balls and retired him on a shallow fly ball to leftfielder Brett Gardner, who cut in front of Ellsbury to make the play. But Andrus blooped a two-run single to right on the first pitch to him for a 9-6 lead. Ryan Rua finally struck out to end the inning.

The top of the ninth began at 10:36 p.m. and ended at 2:33 a.m.

Now, to backtrack much, much earlier.

The Yankees led 6-5 in the ninth when the Rangers came to bat in the top of the ninth with rain pounding the field, as it had been for at least the previous three innings.

Chapman, not appearing very comfortable in the wet conditions, walked leadoff man Robinson Chirinos and fell behind Choo 3-and-1.

Joe Girardi came out of the dugout and discussed the situation with the umpires, appearing to want a delay.

Perhaps coincidentally — though good luck convincing the Rangers of that — crew chief Paul Nauert just a few moments later called for the tarp.

The rain continued . . . and continued . . . and continued.

Eventually, after the delay, Yates, with one career save (coming in 2014 with the Rays), took over against Choo.

Nearly four hours earlier, as members of the ground crew pulled the tarp on the field, Rangers manager Jeff Banister engaged in a heated discussion with Nauert and the other three umpires. His argument seemed to be that Girardi became interested in a delay only when one of his pitchers couldn’t deal with the conditions.

And those conditions had not been good for about two hours as a steady rain accompanied play the majority of the night.

It was a night in which neither starting pitcher had it as the clubs traded leads in the early going.

Ivan Nova entered the game 5-5 with a 5.18 ERA, including 2-4 with a 6.88 ERA in his previous six games, a stretch in which he allowed eight homers. He allowed four runs and six hits in five innings.

Texas righty Chi Chi Gonzalez, a 24-year-old called up from Triple-A Round Rock because of the spate of injuries to the Rangers’ rotation, allowed five runs and 10 hits in five innings.

The Yankees, who had 15 hits, including three each from Carlos Beltran, Mark Teixeira and Didi Gregorius, went ahead 5-4 in the fifth on Gregorius’ two-out RBI single, and Girardi hoped the bullpen would take it from there.

Lefthander Richard Bleier pitched a perfect sixth before giving way to the power arms in the back end, with the Yankees looking to improve to 13-0 when Dellin Betances, Andrew Miller and Chapman appear in the same game.

After Betances struck out one in a perfect seventh, Teixeira’s second homer in as many days made it 6-4. After he went 147 at-bats without a home run before hitting one in the eighth inning Sunday, this was his second homer in five at-bats.

Miller struck out three in the eighth but allowed Odor’s 14th homer, a one-out shot into the second deck in rightfield that made it 6-5.

For a seventh straight start, Ivan Nova didn’t have it.

Fortunately for the Yankees, the pitcher the Rangers called up from the minors earlier in the day didn’t either, allowing them to hold a 6-5 lead in the top of the ninth inning Monday night.

Play was delayed at 10:40 p.m. with one on and none out because of heavy rain, and that’s the way it stayed for more than three hours. At 1:45 a.m., a 2:15 restart time was announced.

Aroldis Chapman walked Robinson Chirinos and fell behind Shin-Soo Choo 3-and-1 before crew chief Paul Nauert called for the tarp.

The Yankees, who had 15 hits, including three each from Carlos Beltran, Mark Teixeira and Didi Gregorius, went ahead 5-4 in the fifth on Gregorius’ two-out RBI single, and Joe Girardi hoped the bullpen would take it from there.

Lefthander Richard Bleier pitched a perfect sixth before giving way to the power arms in the back end, with the Yankees looking to improve to 13-0 when Dellin Betances, Andrew Miller and Chapman appear in the same game.

After Betances struck out one in a perfect seventh, Teixeira’s second homer in as many days made it 6-4. After he went 147 at-bats without a home run before hitting one in the eighth inning Sunday, this was his second homer in five at-bats.

Miller struck out three in the eighth but allowed Rougned Odor’s 14th homer, a one-out shot into the second deck in rightfield that made it 6-5.

Nova entered the game 5-5 with a 5.18 ERA, including 2-4 with a 6.88 ERA in his previous six games, a stretch in which he allowed eight homers. Against the Rangers, he allowed four runs and six hits in five innings.

Texas righty Chi Chi Gonzalez, a 24-year-old called up from Triple-A Round Rock because of the spate of injuries to the Rangers’ rotation, allowed five runs and 10 hits in five innings.

The Rangers, limited to seven hits, twice held the lead.

In the first, Ian Desmond hit his 14th homer, making it 1-0.

Singles by Teixeira, Gregorius and Chase Headley produced a run in the second, and Aaron Hicks’ RBI groundout made it 2-1.

Nova walked No. 9 hitter Chirinos to start the third and Choo doubled into the corner in right. Desmond’s chopper to first tied it at 2, but Nova stranded Choo at third, getting Nomar Mazara to pop out to third in foul ground and Adrian Beltre to ground to first.

The Yankees retook the lead in the bottom half, an odd inning in which there were no hard-hit balls. Beltran lofted a one-out fly to center and Desmond lost his footing, with the ball landing for a single. Brian McCann walked and Teixeira flared a single to center to load the bases. Starlin Castro’s broken-bat single to center made it 3-2.

Choo’s two-out, two-run single in the fourth gave Texas a 4-3 lead, but McCann’s RBI single in the fifth tied it at 4, setting the stage for Gregorius’ two-out RBI single to left.

Notes & quotes: CC Sa bathia, who twisted his right ankle in his previous start, still is slated to take the mound Tuesday night. “He threw his bullpen fine [Saturday], he’s done everything else fine, but I’m still a little concerned about it,” Girardi said . . . The Cubs and Giants, two clubs in need of bullpen help, again were among the teams with scouts in attendance Monday night.