Former world number one Maria Sharapova was knocked out of the Stuttgart Grand Prix at the semi-final stage by France's Kristina Mladenovic 3-6 7-5 6-4 on Saturday.
Wildcard entrant Sharapova, a five-time grand-slam winner, squandered a 6-3 2-0 lead as Mladenovic clawed her way back into the game to win after two hours and 38 minutes.
Sharapova had not lost a set in the previous three matches of her comeback this week in her first event back after a 15-month doping suspension.
Sharapova out of contention for French Open qualifying spot
Her defeat means she will finish outside the top 200 when the rankings are released on Monday, ruling out a qualifier spot for the French Open. A decision is to be made by the France Tennis Federation on May 16 on whether to grant Sharapova a wildcard.
Sharapova, who was banned for using meldonium after testing positive at the 2016 Australian Open, has also received wildcards for forthcoming tournaments in Madrid and Rome.
The Russian was in complete control at the start, with her French opponent showing nerves, and a second double fault allowed Sharapova to race 4-1 clear.
She sealed the first set when Mladenovic sent a crosscourt backhand into the net after just 38 minutes.
The Russian, a three-time champion in Stuttgart, broke Mladenovic again at the start of the second set and looked to be cruising to victory as she took a 2-0 lead, attacking her opponent's second serve.
But despite conceding 11 double faults, Mladenovic improved her baseline game, chasing Sharapova with powerful ground strokes across the court.
She almost paid the price for her weak second serve -- a liability throughout the match -- but Mladenovic survived three break points to move into a 6-5 lead.
She took the set when Sharapova sent a forehand wide on Mladenovic's first break opportunity.
The pair traded blows early in the third before the Frenchwoman grabbed a break to go 4-2 up.
The 23-year-old world number 18 stood her ground when she found herself 0-40 in the next game, moving to 5-2, but a disastrous service game allowed the Russian briefly to come back before Mladenovic completed a memorable win to reach her first Stuttgart final with another break.
Mladenovic on Sharapova return
"On one hand, I totally understand the tournaments want her in the draw, because she is very famous and they want more attention, which is part of the business.
"On the other hand, you can ask if it is fair to get a wild card. It's a fact that she was caught by anti-doping, but she wasn't the first one.
"Others have also had the right to come back and play tennis, but with a different road, they wouldn't get invitations to tournaments.
"Of course, she is authorised to play tennis again, but why would she get that extra help compared to other players?"