The Serbian 11th seed beat Sharapova, seeded eighth, for the first time in seven years with a blistering display of power to reach her sixth quarter final of 2014.
The last time Ivanovic, 26, beat the Russian was in the semi-finals of the 2007 French Open. She went on to lose the final to Justine Henin.
World number one Serena Williams brushed aside fellow American Varvara Lepchenko 6-1 6-2 to draw level with sister Venus for the most career wins among active players. Serena's 652nd win set up a quarter-final against China's Zhang Shuai.
Italian Open third round results
1-Serena Williams (US) beat Varvara Lepchenko (US) 6-1 6-2
6-Jelena Jankovic (Serbia) beat 12-Flavia Pennetta (Italy) 6-2 6-3
Zhang Shuai (China) beat Christina Mchale (US) 6-2 4-6 6-2
11-Ana Ivanovic (Serbia) beat 8-Maria Sharapova (Russia) 6-1 6-4
3-Agnieszka Radwanska (Poland) beat Francesca Schiavone (Italy) 6-4 6-1
10-Sara Errani (Italy) beat Petra Cetkovska (Czech Republic) 6-4 7-6(3)
2-Li Na (China) beat Samantha Stosur (Australia) 6-3 6-1
13-Carla Suarez Navarro (Spain) beat 4-Simona Halep (Romania) walkover
- Sports & Recreation
- Simona Halep
- Samantha Stosur
- Carla Suarez Navarro
- Sara Errani
- Serena Williams