Ukraine's Dolgopolov, ranked 31st in the world and seeded 28th in the first Masters tournament of the year, notched his first victory over the Spanish superstar after five prior defeats.
The most recent of those was in the claycourt final at Rio de Janeiro two weeks ago.
Nadal had reached the semi-finals at Indian Wells every year since 2006, winning the title in 2007, 2009 and last year.
Down a break at 5-3 in the third, Nadal broke Dolgopolov to get the set back on serve and from there they went to the tiebreaker.
Also Read
He put his second serve in play, and sealed the win with a blistering forehand that Nadal couldn't get back.
"I feel great, I mean, as after every win, of course," Dolgopolov said. "This one was bigger, and I beat the defending champion, number one in the world.
"I guess I just need to enjoy this evening and forget about it tomorrow and try to compete the rest of the tournament. I'm still in."
"He played great," Nadal said. "He had good tournaments in Rio, in Acapulco, so it's great what he is doing.
"At the end I have to analyze my part. I had enough breaks to win the match, but I didn't play well enough from the baseline then to be solid with my serve.