A sombre Nadal announced his withdrawal a couple hours before he was scheduled to take the court at Indian Wells Tennis Garden.
"I warmed up today and I felt that my knee was not good to compete at the level I needed to compete in semi-finals", Nadal told the tournament's official website.
"It's tough for me to accept all these things that I'm going through in my career", the 32-year-old said, BBC Sport reported.
Nadal had been set to play longtime rival Roger Federer later Saturday.
The Nadal-Federer matchup would have been the 39th meeting in their careers and the first in 16 months.
Federer will now play the victor of the tournament's other semi-final between Austria's Dominic Thiem and Canadian Milos Raonic.
His run at the first Grand Slam of the year marked his return to competition for the first time since a similar knee problem forced him to retire from his US Open semi-final against Juan Martin del Potro in September.
The World No.2 had made it to the last four without dropping a set, so it was especially devastating when knee pain flared up during his 7-6 (7/2), 7-6 (7/2) quarter-final victory over Russian Karen Khachanov on Friday.
Nadal remains without a title since Toronto in August past year and a win over Federer since the Australian Open in 2017 but with a four-week break he will re-emerge for the clay-court season in Monte Carlo before yet another French Open at Roland Garros. When he was coming up, I was world No 1 and he was 17. While on one hand, Roger is extremely fresh after spending not so much time on court, on the other Rafa got injured to his right knee when playing Khachanov in the quarterfinal. "You can imagine that I can't be happy".
Last Sunday, Serena Williams retired from her match against Garbine Muguruza with what was described as a viral illness.