INDIAN WELLS, Calif. (AP) — Dominic Thiem outlasted Milos Raonic 7-6 (3), 6-7 (3), 6-4 on Saturday to reach the BNP Paribas Open final after Roger Federer advanced when Rafael Nadal withdrew because of a knee injury.

A somber Nadal announced his withdrawal a couple hours before he was scheduled to take the court at Indian Wells Tennis Garden.

"I warm up today in the morning, and I felt that my knee was not enough good to compete at the level that I need to compete," he said.

Federer was warming up on another court at the same time as Nadal and figured the match was on. However, Nadal soon texted him it wasn't going to happen.

"It's a big letdown," said Federer, who came on court in khaki shorts and a gray cardigan to address fans. "I know the anticipation is there from the crowd and also us players. I'm excited to be in the finals but not this way."

The 32-year-old Spaniard's right knee flared up in the second set of his 7-6 (2), 7-6 (2) victory over Karen Khachanov on Friday in the quarterfinals. He twice called for a trainer, who applied tape just below Nadal's knee. It was obvious that Nadal's movement was hampered.

Nadal said he won't play again until the Monte-Carlo Masters on clay in mid-April.

"I don't have doubts today that I will be ready for Monte Carlo," he said.

It would have been the 39th career meeting between Nadal and Federer, who seeks a record sixth title at Indian Wells and the 101st in his career on Sunday.

"I know every one we have now could be our last," Federer said. "It's a special rivalry, maybe the most special with Rafa and Novak (Djokovic)."

Sunday's women's final features 18-year-old Canadian wild-card Bianca Andreescu against two-time major champion Angelique Kerber.

Thiem reached the semifinals via walkover after Gael Monfils withdrew from their quarterfinal with a strained left Achilles.

Against Raonic, Thiem earned the only break of the third set in the fifth game. He led 5-3 and served it out, winning on his second match point with a backhand volley.

"The only break point I had to save was in the last game, and that was what I wanted to do, to play my service games well and not let him have too many chances," Thiem said.

Thiem and Federer have split their four previous meetings, with only one going three sets. Federer won the last time they played at the ATP Finals in London in November.

"It's always something special to play him," he said.

Thiem has never won a Masters 1000 title, losing in two previous finals.

Knee problems have dogged Nadal for years, and they cut short his 2018 season after the U.S. Open in September. He was forced to quit two sets into his semifinal against Juan Martin del Potro.

Nadal choked up discussing his withdrawal last fall, and he appeared near tears on Saturday.

He admitted that he sometimes is sad because he feels at a disadvantage against his opponents due to his continued knee issues that force him to limit his practice and playing time.

Then he gathered himself, saying, "It's not the moment to complain much. With all this stuff, I still where I am today."

The year began promisingly enough. Nadal didn't drop a set in reaching his fifth Australian Open final, where he lost to Djokovic. He's ranked No. 2 in the world and has a match record of 11-2.

"Still tough because I felt more or less OK during this beginning of the season in terms of my knee," he said. "Now it starts the process that I have to decide what direction we have to take to recover well and to recover as soon as possible."

Even with all of his injuries, Nadal indicated he has no intention of giving up playing on hard courts, the surface for two of the four Grand Slam events.

"My goal is to play on all the surfaces," he said.

With time to fill before the women's and men's doubles finals, Djokovic and Pete Sampras teamed for a one-set doubles match against John McEnroe and tournament director Tommy Haas. Comedian Jon Lovitz served as chair umpire.

_

More AP tennis: https://apnews.com/apf-Tennis and https://twitter.com/AP_Sports