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.
Dolgopolov kept his composure on the first match point, when he initially thought he had won the contest with an ace only to see that call overturned on a challenge from Nadal.
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.”
It was Dolgopolov’s second victory over a top-five foe in less than a month. He upset Spain’s David Ferrer en route to the final in Rio.
“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.
“It’s not a problem with my serve, it was more a problem with my baseline shots. I didn’t go for the points. I played with too many mistakes.”
Nadal broke Dogopolov to open the match – but they ended up trading breaks in the first four games and it was the Ukrainian who gained the decisive break for a 5-4 lead then withstood two break points to pocket the set.
After Nadal had knotted the contest at one set each, Dolgopolov took control with a break for 4-2 in the third.
But he was broken at love when he served for the match at 5-3 and Nadal then held at love for 5-5.
Leading 6-5 in the tiebreaker, Dolgopolov had to survive one last hiccup when his apparent ace was ruled out after a challenge by Nadal.
He calmly put his second serve in play, and sealed the match with a forehand winner.
“It’s not a drama,” Nadal said. “It’s a loss. I accept that, try to rest a few days and be fresh mentally and I hope to be ready for Miami.”
Dolgopolov, meanwhile, will take on Italy’s Fabio Fognini in a rematch of their quarter-final in Rio.
Fognini beat Gael Monfils 6-2, 3-6, 7-5, surviving two match points when the Frenchman double-faulted on both.