The sixth-seeded Sharapova needed 3 hours, 24 minutes for her 100th clay victory, three days after her 27th birthday.
Sharapova, who is bidding to win the tournament for the third time in a row, next faces fellow Russian Anastasia Pavlyuchenkova, who defeated Latvian qualifier Diana Marcinkevica 6-3, 6-2.
No. 8 seed Sara Errani recovered from a double break down in the second set to defeat Klara Koukalova of the Czech Republic 6-3, 6-4 for the Italian's first win in five visits to Stuttgart.
Spain's Carla Suarez Navarro defeated Russia's Ekaterina Makarova 6-0, 6-4, and Roberta Vinci had a 6-3, 6-2 win over Annika Beck, ensuring the 20-year-old qualifier was the first German knocked out of the tournament.