It's Federer vs. Nadal again, only this time it'll be in the semifinals.

Roger Federer beat Hubert Hurkacz 6-4, 6-4 and Rafael Nadal got by Karen Khachanov 7-6 (2), 7-6 (2) on Friday to set up the old rivals' 39th career meeting and first in 16 months.

Neither Federer nor Nadal has dropped a set in four matches in the desert. Federer has been broken just once, while Nadal has dropped serve three times, twice against Khachanov.

Nadal stands in the way of Federer's pursuit of a record sixth title at Indian Wells.

Still, the Swiss superstar was rooting for Nadal to advance against his 22-year-old opponent.

"Playing against young guys to eventually get to Rafa, that's exciting," said Federer, who also faced an opponent the same age as Khachanov.

Nadal's right knee flared up in the second set for the first time during the tournament. He called for a trainer who applied tape just below the knee. The trainer returned again with Nadal leading 3-2 in the second set.

"My goal and my idea is be ready for tomorrow," Nadal said. "I cannot guarantee how I'm going to wake up tomorrow morning."

Knee problems have dogged the 32-year-old Spaniard in recent years, and they cut short his 2018 season after the U.S. Open in September.

"I love to play on hard (courts), but probably my body doesn't love it that much," Nadal said. "As I say before, is not only about today, is about tomorrow. Maybe we're going to pay the price at the age of 45 or something. That will be not nice. When I see some old legends walking around the tour, is tough to see."

Federer is on a five-matching winning streak against Nadal, who lost to him all four times they played in 2017, including the last time at the Shanghai Masters in October of that year.

"You look back at what I did well there, but you can't just copy-paste and play exactly the same thing again," Federer said.

The first semifinal Saturday pairs Milos Raonic of Thornhill, Ont., and Dominic Thiem of Austria.

Nadal improved to 6-0 against Khachanov, although it was tougher and longer than Federer's win.

Nadal trailed 6-5 before Khachanov's forehand error forced the second tiebreaker, which Nadal dominated to close out the match that lasted just over two hours.

"He's unbelievable in defence," Khachanov said. "When you want to try maybe just to play more safe then he suddenly steps in and he counterattacks. He steps in and then he starts moving you, and then you are again in trouble."

Federer believes Nadal is playing better than he did in losing the Australian Open final to Novak Djokovic, who was upset earlier in the week.

"When Rafa is healthy, especially in a place like here in Indian Wells where he feels comfortable, he's clearly very tough to play," Federer said.

Against Hurkacz, Federer fought off two break points in the second set, including the last game when he closed the match with a forehand winner off a short ball.

"Not that I didn't expect it," Federer said, "but it definitely went better than I thought it would."

Hurkacz, a 22-year-old Pole, earned three-set upsets of No. 28 Lucas Pouille, No. 6 Kei Nishikori and No. 24 Denis Shapovalov to make his first ATP Masters 1000 quarterfinal against his childhood idol. Federer was playing in his 83rd at this level.

"Playing against him for the first time on the big stadium of a great crowd here was for sure different feeling," Hurkacz said.

Federer won his 100th career title in Dubai recently, leaving him eight from tying Jimmy Connors' record for most in the Open era. At 37, he became the oldest player to win a tour-level title since Marty Riessen won at Lafayette, Louisiana, in 1979 at the same age.

"I'm holding my serve comfortably. I'm in a good place mentally when I go into my service games," Federer said. "It showed this week thus far, so I hope I can keep that up."

— with files from The Associated Press