The defeat left the Yankees two games ahead of the Rays and six up on the third-place Red Sox in the AL East, but has to be viewed as a missed opportunity.

“We had a couple of opportunities to win the game and we weren’t able to get it done,” said Joe Girardi, whose club went 3-for-15 with runners in scoring position and stranded 11 runners.

When play resumed after a second rain delay of 2 hours and 10 minutes in the fifth inning, the temperature had dropped to 73 degrees, which was a welcome relief from the 98 it was when Kyle Davies threw the first pitch. The game was stopped for 31 minutes in the home third.

Davies (6-7) posted the victory, giving up three runs and seven hits in five innings.

Outside of the third inning, when the Yankees went 3-for-5 with runners in scoring position, they failed to hit in the clutch. They went 0-for-2 in the first, 0-for-3 in the fourth, 0-for-2 in the sixth, 0-for-2 in the eighth and 0-for-1 in the ninth.

Joakim Soria worked the ninth for his 32nd save, which tied him for the AL lead.

When Royals catcher Jason Kendall dropped Mark Teixeira’s foul pop with one out in the ninth and Derek Jeter on first, the stage was set for the Yankees to take advantage. Instead, Teixeira whiffed. Alex Rodriguez’s single to left-center advanced Jeter to third and put runners at the corners for Robinson Cano.

Cano started the night in a 1-for-14 slump with runners in scoring position and extended that by flying out in the first to strand two. The slide is at 2-for-17 after Cano’s ground out ended the game.

There was a 21-minute rain delay before the beginning of the home third. Minutes before the second rain delay hit in the fifth, Butler hit an opposite-field homer off the right-field foul pole that gave the Royals a 4-3 lead to take into the second stoppage.

Helped by two Royals misplays in the third when the hosts weren’t charged with errors, the Yankees tied the score, 3-3.

Curtis Granderson singled with one out and made third on Teixeira’s double to right. Rodriguez’ grounder up the middle was bobbled by second baseman Mike Aviles and ruled an RBI single. Cano singled in Teixeira before Jorge Posada’s grounder to first baseman Butler should have been an inning-ending 3-6-3 double play, but the return throw pulled Butler off the bag.

Lance Berkman made the mistake hurt with an RBI double that tied the score.

Moseley gave up three singles but not a run in the first inning thanks to Brett Gardner’s accurate throw from left field to home, which retired Gregor Blanco for the second out. With runners at first and second, Moseley ended the inning by getting Kila Ka’Aihue on a routine fly to center.

He wasn’t as fortunate in the second when the Royals scored three runs via three hits and three stolen bases. Blanco swiped his second and third bags of the game, Kendall had a sacrifice fly and Yuniesky Betancourt, the No. 9 hitter, delivered a two-run double on a 0-2 pitch.

The Yankees failed to take advantage of Gardner’s leadoff double in the fourth. Jeter’s bunt attempt went into the air and fielded by Davies. Granderson popped up to third and Teixeira fanned.

They also wasted a Jeter leadoff single and one-out walk to Teixeira walk in the first. Rodriguez grounded out to short and Cano stranded runners on second and third with a stress-free fly to right.