Rafael Nadal was sent packing by Ukraine's Alexandr Dolgopolov 6-3 3-6 7-6 (7-5) after Sharapova fell to Italian qualifier Camila Giorgi 6-3 4-6 7-5 as last year's men's and women's singles champions both crashed out.
Rafael Nadal blew a 4-2 lead in the deciding tiebreak after the Spaniard had fought his way back from 5-2 down in the deciding third set.
"I wanted to play very well here. I had good success in this tournament in the past, a tournament I always feel good about," said Nadal, who will now turn his attention to the Sony Open in south Florida.
"I'm going to keep working hard to try to be ready to play better in Miami."
Rafael Nadal beat Dolgopolov in the final of the inaugural Rio Open last month but the Ukrainian got his revenge on the world number one in the Californian desert.
"I feel great, as after every win, of course. I beat the defending champion and the number one in the world," said Dolgopolov, whose next opponent is Fabio Fognini after the Italian saved two match points in a 6-2 3-6 7-5 win over Frenchman Gael Monfils.
Giorgi, a 22-year-old ranked 79th in the world, made the fourth round of the U.S. Open last year as a qualifier, but her win over the world number five Russian was the biggest of her career.
"I did not play a good match at all," said Sharapova, who dropped serve eight times and committed 58 unforced errors.
"(I've) never played against her, but she's someone that doesn't give you much rhythm. She's quite aggressive, but some shots she hits incredible for a long period of time.
"Sometimes they go off a bit. But, if I'm speaking about my level, it was nowhere near where it should have been."
Giorgi will play her countrywoman Flavia Pennetta in the next round after she beat Australian Sam Stosur 6-4 3-6 6-1.
There were no other major surprises although Britain's Andy Murray was forced to dig deep to see off promising Czech Jiri Vesely and avoid a similar fate.
The Wimbledon champion won 6-7 (7-2) 6-4 6-4 but only after clawing back from the brink of defeat against the 20-year-old Vesely.
Murray lost the opening set despite going up an early break but then struggled on serve against the left-handed Vesely, ranked 77th in the world.
The Scotsman was broken six times in the match and trailed in both the second and third sets but fought back each time, reeling off four consecutive games to seal victory.
"It was just one of those matches where there wasn't one period where I thought that the level of tennis from both of us was high at the same time," said Murray.
"That can create a lot of breaks and a lot of sort of back and forth swings in the match. It wasn't just the start of the match that was frustrating. The whole match was."
Murray will play Canada's big-serving Milos Raonic in the next round as he bids to win one of the few North American hardcourt titles to have eluded him.
Switzerland's former world number one Roger Federer also advanced after he was pushed all the way by Russia's Dmitry Tursunov before winning 7-6 (9-7) 7-6 (7-2).
Federer, who won his 78th career singles title in Dubai earlier this month, will play either German Tommy Haas or Japan's Kei Nishikori in the fourth round.
"I feel like I'm in a good place," said Federer, a four-time champion at Indian Wells. "I know what my solid level is. Even if I won 6 and 6 today, I just feel like I was calm and served for the set.
"Okay, got broken. Still managed to stay calm. Down ... in the second; stayed calm and came back. So those are the moments where you feel there is confidence around somewhere."
Australian Open champion Stanislas Wawrinka extended his unbeaten run this year to 13 matches with a ruthless 6-0 6-2 win over Italy's Andreas Seppi in just 49 minutes before joining forces with Federer in the doubles.
China's Li Na, the top seed in the women's draw, had no problems booking her place in the fourth round, beating Karolina Pliskova of the Czech Republic 6-3 6-4.
Despite dishing up nine double-faults and having her own service broken twice, Li was far too strong and streetwise for Pliskova, wrapping up the win with an ace.
"At least I could win the last point and stay in the tournament," Li said.
"If you're a tennis player, you'll make double faults. At least I can improve my serve even more from here."
Li is looking to win her first Indian Wells title and continue her great start to the year after capturing the Australian Open women's title.
Her next opponent is Canada's Aleksandra Wozniak, who defeated Russia's Anastasia Pavlyuchenkova 6-1 6-7 (3-7) 6-0. (Reporting by Julian Linden in New York; Editing by Greg Stutchbury/Patrick Johnston)