NEW YORK — Rafael Nadal felt the pain sear into his right knee early in his U.S. Open semifinal, on what he called “a bad movement.” It was a familiar pain, one that he’s dealt with off-and-on for years.

The defending champion looked up at his guest box and indicated something was wrong. He tried to continue. Eventually, he could not.

Nadal stopped playing after dropping the opening two sets Friday night, putting Juan Martin del Potro back in a Grand Slam final for the first time since winning the 2009 title at Flushing Meadows.

“That was not a tennis match at the end. Just one player playing, the other staying on one side of the court,” Nadal said. “I hate to retire, but staying one more set out there, playing like this, would be too much for me.”

Del Potro was leading 7-6 (3), 6-2 after two hours of play when Nadal shook his head and said he had to stop.

“Of course, it’s not the best way to win a match,” said del Potro, who hugged Nadal when it was over. “I don’t like to see him suffering on court today. So I’m sad for him.”

Del Potro will play for the title Sunday against Novak Djokovic, who served impeccably and used his usual brand of court-covering defense to reach his record-tying eighth U.S. Open final by beating Kei Nishikori 6-3, 6-4, 6-2.

Djokovic missed the tournament last year because of an injured right elbow that eventually required surgery. But he is back to his best as he bids for his third title at Flushing Meadows and 14th Grand Slam trophy overall.

Nadal, the No. 1 seed, has a history of tendinitis in his knees, and he’s often cited that when withdrawing from tournaments. He was visited by a trainer at the changeover after the match’s seventh game and tape was applied below the joint. At the next changeover, though, Nadal pulled off the tape.

After the third game of the second set, he had a medical timeout so the trainer could massage his right leg and once again apply tape.

But Nadal’s movement was clearly limited, and by the end he was walking with a bit of a hitch in his gait between points. At one juncture, he approached the chair umpire to complain about a late call from a line judge and mentioned in passing that he was going to have to quit. Soon enough, he did just that.

Nadal said he didn’t know what kind of effects might have been lingering from his quarterfinal victory over Dominic Thiem, which lasted five sets and nearly five hours. But he had some knee issue earlier in the tournament, when he had it taped during his win against Karen Khachanov in the third round.

For del Potro, it was an odd way to return to an important summit. Nine years ago, he stunned Nadal in the semifinals, then Roger Federer in the final to win the U.S. Open at age 20. He was considered a rising star, but a series of wrist operations slowed his career and kept him out of two years’ worth of major tournaments.

He has returned to the height of his powers, up to a career-best No. 3 in the rankings.

“It means a lot to me,” del Potro said. “I didn’t expect to get in another Grand Slam final.”

On Sunday, the powerful Argentine with the massive forehand that zips along at more than 100 mph.

After nearly two weeks of heat in the 90s, it cooled to the 70s, although the humidity was still at about 70 percent. The lights in Arthur Ashe Stadium were on for the start of Nadal vs. del Potro, and they engaged in some terrific shotmaking during the first set.

A group of about a dozen of del Potro’s friends from Argentina would salute important points won by their guy, often breaking into choruses of “Ole, ole, ole, ole, del Po, del Po!” Thousands in the crowd would lend their voices to the song; yet others would try to drown them out with support for Nadal.

Those pals helped del Potro get through the toughest times, as he would need to repeatedly return to have surgery. He dealt with depression. He considered quitting his sport.

“I didn’t know,” he said, “if I will be a tennis player again or not.”

When Nadal missed a forehand wide, then put a backhand into the net, the opening set belonged to del Potro, who shook his fist and yelled, “Vamos!”

As del Potro continued slamming serves at faster than 130 mph, whipping that trademark forehand, and even making hay with his much-improved two-handed backhand, Nadal offered less and less resistance. It was clear something was wrong. He even barely took any time between points while serving – and he’s known as one of the slowest guys on tour.

Afterward, he couldn’t say for sure how long he might be sidelined. Could be a week. Could be months. No way to know yet.

All that was certain at that point was that his bid for a fourth U.S. Open title, and second in a row, was gone. As was his try for an 18th Grand Slam trophy overall as he tries to catch up to Federer’s 20, the record for men.

This one goes into the books as a loss, only his fourth in 49 matches in 2018. As Nadal himself noted during a news conference that closed as he began to choke up, this was the second of those defeats that involved him quitting during a Grand Slam match because of an injury; the other was in the fifth set of his Australian Open quarterfinal against Marin Cilic.

To be sure, del Potro knows that sort of setback, given all of his own health woes.

“I’ve been fighting with many, many problems to get (to) this moment,” del Potro said. “I’m here now.”