NEW YORK (AP) Nick Kyrgios already was flexing his injured right hip before a game late in the first set of his third-round match at the U.S. Open. Then came a wild point that ended with him skidding to a stop on his knees on the sideline.

Not long after that, the 14th-seeded Kyrgios again tried to stretch out his hip, before taking a medical timeout for help from a trainer. Soon enough, he was barely moving during points. Eventually, Kyrgios stopped while trailing 4-6, 6-4, 6-1 on Saturday night, allowing 63rd-ranked Illya Marchenko of Ukraine to reach the fourth round at a Grand Slam tournament for the first time.

''My hip was bothering me my first two matches and I got through,'' Kyrgios said. ''I guess it was just a matter of time.''

He dealt with a hip problem earlier this season.

''I've got to take more time and be more diligent with (the) gym and everything, so this doesn't happen to me,'' said the 21-year-old Australian, known for his prodigious talent and on-court mood swings.

Marchenko did not hide his excitement about what he's now achieved, exclaiming to the Arthur Ashe Stadium crowd during an on-court interview: ''It's round of 16! Oh, my God!''

He will face two-time major champion and No. 3 seed Stan Wawrinka next.

''I played him this year already. He killed me completely, outplayed me in everything,'' said Marchenko, who lost 6-3, 6-2 to Wawrinka on a hard court at Indian Wells, California, in March.

Kyrgios said he hit a couple of wide forehands ''that didn't feel too good,'' and he showed signs of trouble after only nine games, even as he played a calm, patient brand of baseline tennis that he's not necessarily known for. At 2-all in the second set, he sprinted forward to get to a sharply angled shot by Marchenko, reaching out to barely lift the ball back over the net for a backspin-filled winner. But Kyrgios' momentum nearly carried him all the way to the chair umpire's stand and he went down to the ground, skinning his left knee and drawing a bit of blood.

After getting broken to trail 5-4 in the second set, Kyrgios flexed that hip again.

''It's almost just as hard mentally to play with something like that,'' he said.

When that set ended, Kyrgios headed to the locker room with a trainer. But things didn't improve. He spent much of the third set barely moving between points, calling for the trainer, cursing, and, at one point, muttering that he felt as if he'd been hit by a bus.

''You never know if the guy's just irritated or it's really bothering him,'' the 28-year-old Marchenko said. ''So I tried to stay focused.''

Down 4-1 in the third, Kyrgios sat down gingerly in his changeover seat, covered his face with a white towel while speaking to the trainer, and then appeared on the verge of tears.

A couple of games later, he quit.

''Well, I'm a little bit shocked right now,'' said Marchenko, whose red shirt was decorated with white skulls and stars. ''I'm really sorry for Nick. I didn't want to win this way. ... A win is a win.''


Follow Howard Fendrich on Twitter at http://twitter.com/HowardFendrich