World number five Nadal survived a scare from Alexander Zverev, rallying to beat the German teenager 6-7 (8/10), 6-0, 7-5 and reach the quarter-finals.
Two-time defending champion Djokovic cruised into the quarters by beating Feliciano Lopez 6-3, 6-3 but French Open champion Stan Wawrinka bit the dust in joint ATP and WTA Tour tournament.
Nadal, who saved a match point in the third set, said he had to adjust quickly to 18-year-old Zverev's style, especially the German's second serve, which he consistently blasts at speeds of 120 mph.
"If he puts the first serve in at over 130 mph then you are in big trouble. So I think that I'm here, and still alive."
Indeed, Zverev had the 14-time Grand Slam champion Nadal on the ropes for much of Wednesday's two and a half hour contest and following the match the Spaniard predicted great things for the teen.
"He is amazingly talented. He is probably going to be the number one in the world," said Nadal after their first career meeting.
Up 40-30, the German then made three straight unforced errors to hand the game to Nadal.
The nine-time French Open winner Nadal then used his experience to seize control and win the final three games and close out the match.
"I am happy about the way I fought and my belief out there that I can win in the toughest situations," Nadal said. "I was able to find some solutions in tough moments. I was able to play some good points in tough moments."
fourth round by David Goffin.
"It was a match without a brain," said Wawrinka, who lost 6-3, 5-7, 7-6 (7/5) to 15th seed Goffin.
Wawrinka had his serve broken seven times after dropping his serve just once in his previous two matches at Indian Wells.
"I had a tough time staying focused and being patient. I still tried to fight," Wawrinka said. "He deserved to win."
There were 13 total service breaks in the two hour, 25 minute marathon match.
"Two times I came back. I had the chance in the third set to break him and finish it at 5-5 and I didn't," said Wawrinka.
Wawrinka, ranked fourth in the world, blasted six aces but had five double faults and won just 43 percent of his second serves.
Goffin's victory snaps a 14-match losing streak for the Belgian against top-10 opponents. His last win over a top-10 player was against Milos Raonic in 2014 at Basel.
Cilic hammered 15 aces and broke Gasquet five times.
Hard-serving Canadian Raonic toppled sixth-seeded Tomas Berdych 6-4, 7-6 (9/7) to reach the quarter-finals.
Raonic's victory over Nadal in the quarters at Indian Wells last year was voted one of the top matches of 2015.
"I have significantly improved over time," said the world number 12. "I'm pretty efficient at the net now. I cover the angles I'm supposed to cover. I make the volleys I'm supposed to make."
Raonic will face France's Gael Monfils, who defeated claycourt specialist Federico Delbonis 6-3, 6-4.
