“This was not the result that I wanted, but I can take a lot out of this match,” Sharapova said. “I’ve not competed for a few weeks, but I played pretty solid and did all of the right things.
“I served well in the first set but had a few doubles at the wrong time. Physically, I felt quite strong.”
The five-time Grand Slam champion, who turned 31 last week, looked to be in control as she made just two unforced errors in winning the opening set.
But Garcia, who had never beaten the Russian in four previous meetings – they last played in Madrid three years ago – rallied in the second set as she came from 4-2 down and and levelled the contest in a tie-break.
The 41st-ranked Sharapova returned to tennis in Stuttgart exactly a year ago after finishing a 15-month doping ban for meldonium and reached the semi-finals. She claimed an early break in the third set, but lost it in the third game as Garcia tightened the screw on the crowd favourite.
Sharapova was broken to trail 4-5 and put her opponent under momentary pressure at 0-30 as Garcia tried to serve out the win.
But the world number seven succeeded on her second match point as Sharapova struck a return wide to exit after two and three-quarter hours of battle on the indoor clay court.
Sharapova said her game might have been compromised by weeks of forearm injury recovery after last playing in Indian Wells six weeks ago.
“Overall I didn’t react as well as I could against a server like her, she got lot of free points,” Sharapova said.
“I didn’t get enough balls back. We were both playing fast, and aggressive.
“I need to be smarter in the winning position.”
Garcia will next take on Ukrainian qualifier Marta Kostyuk who scored a 6-4, 6-1 defeat of Antonia Lottner.
The youngster, who doesn’t turn 16 until just before the start of Wimbledon, was joined in round two by Czech fifth seed Karolina Pliskova, who beat Dutchwoman Kiki Bertens 6-2, 6-2.Kostyuk made a breakthrough with a surprise third-round showing at the Australian Open as a qualifier, finally losing to compatriot Elina Svitolina.
World number 158 Kostyuk has since claimed a second-tier title in Burnie, Australia and reached a final in Zhuhai, China in March. Her defeat of Lottner, ranked 155th, took just under 90 minutes, with the teenager breaking four times while losing serve only once.
Pliskova, who has been on site for a week training, is playing Stuttgart for the third consecutive year, after losing to eventual champion Laura Siegemund in the 2017 quarter-finals.
“I felt the best today and for sure it was not her best match but that was not much to do with me,” Pliskova said.
“The serve was good and I got a lot of free points, my shots were working – there was no problem from my side today.”
The Czech dominated Bertens, with the winner firing six aces and breaking four times.
The former world number one Kerber runs into Petra Kvitova, who sealed the Czechs’ semi-final win with a crushing 6-2, 6-2 over Kerber on Sunday at the Porsche Arena.
Kerber was far from her form of earlier the year as she also lost her first rubber in straight sets against Karolina Pliskova. Goerges went down against the two-time Wimbledon champion Kvitova Saturday before beating Pliskova to briefly keep Germany’s chances alive.
The Germans have done well at recent editions of the star-studded home event, with Goerges winning in 2011, Kerber in 2015 and 2016, and Laura Siegemund in 2017.
Kerber appeared fairly composed Monday when she met the press, saying: “The tournament starts as of today. I am fully focused. I was disappointed last night. But I am professional enough to get over it. I want to play my best tennis in front of a home crowd. “It is always tough against Petra. Now I have a second chance. I will change a few things and sit down with my coaches later today to prepare the match.”
The 12th-ranked Kerber is set to play against number 10 Kvitova today, with the Czech leading their series 6-5.