Yankees' Yangervis Solarte reacts after striking out during the third inning against the Kansas City Royals on Sunday.

That agonizing fate followed into the ninth inning, when the tying run moved into scoring position – with none out – and moved no further.

“A game of missed opportunities, [and] we had a lot,” said Derek Jeter, summing up a 2-1 Royals victory before 24,614 to the Yanks’ newest height in offensive frustration.

In falling back to .500, the Yankees (31-31) were an astonishing 1-for-17 with runners in scoring position Sunday – an empty afternoon during which Hiroki Kuroda’s solid seven innings were wasted.

“A great performance,” manager Joe Girardi. “But we couldn’t do anything with it.”

And the agony came in all forms.

Girardi’s club loaded the bases with none out and couldn’t score. The Bombers wasted leadoff doubles and stranded runners at third with less than two out, and still had a shot to change things in the ninth.

Against hard-throwing closer Greg Holland, Ichiro Suzuki opened with a single and moved to second on a wild pitch.

But Brian Roberts popped out, pinch-hitter Mark Teixeira grounded out and Brett Gardner struck out – cementing the Yanks’ seventh loss in their last 10 games. Over that span, the Yankees haven’t scored more than four runs in a game and are averaging 2½ runs per.

“We’ve got to find a way to get those guys in. Lately we haven’t done a very good job of it,” Gardner said, lamenting the runners left in scoring position with less than two out.

“We know it, we’re aware of it, we see it, we feel it,” Gardner said. “And I think for the most part guys have been pretty upbeat. It’s not like we’re trying to fail, it’s not like we’re not working hard or don’t care. We take a lot of pride in what we do, and it’s frustrating when you don’t get the job done.”

Royals starter James Shields toughened under pressure, escaping a second-inning, bases-loaded jam by striking out Kelly Johnson, getting Gardner to tap into a force play at the plate and striking out Jeter – both K’s coming on his signature change-up.

The rest of the day was a rerun.

Jacoby Ellsbury’s leadoff double in the third gave him a 13-game hitting streak, but he was stranded.

In the seventh, Gardner belted a one-out triple to center and remained on third base – representing the tying run – as Jeter grounded out with the infield in and Ellsbury struck out looking.

Shields (7-3) yielded just an unearned run in the sixth, his final inning, when Yangervis Solarte doubled, moved to third on a passed ball and scored on Suzuki’s groundout.

By then, the Royals (31-32) had all the runs they’d need.

Kansas City collected four two-out hits in the second, including Lorenzo Cain’s RBI double past Ellsbury’s dive in center field and Mike Moustakas’s RBI dunk single.

Kuroda (4-4) gave up just one more hit and faced the minimum from the third inning through the seventh.

“You feel bad. Hiro did outstanding,” said Jeter, mindful of the responsibility of the Yanks’ lacking lineup.

“These are the times when you’ve got to keep swinging,” Jeter said. “The only way you get out of it is to swing out of it.”

Even Girardi couldn’t fault their approach, though.

“Somehow you’ve got to find a way to get it done,” the manager said tersely. “You stay positive, you keep encouraging the guys.”

Gardner admits that “guys have been frustrated, guys have been mad, angry at times,” but for the most part it’s been a feeling that the next rally is around the corner.

“You like the fact we continued to battle, but the bottom line is we’ve got to score some runs,” Jeter said. “We’ll turn it around.”