PARIS (AP) -- Maria Sharapova needed a set to get going, and once she got going, she couldn't be stopped.
The seventh-seeded Russian advanced to the semifinals of the French Open for the fourth straight year, rallying to beat Garbine Muguruza of Spain 1-6, 7-5, 6-1 Tuesday.
In the men's tournament, second-seeded Novak Djokovic and 18th-seeded Ernests Gulbis advanced and will face each other in the semifinals.
It's the second straight match in which Sharapova lost the first set but completely controlled the third. Against Muguruza, Sharapova won nine of the last 10 games. In the previous round against Samantha Stosur, she won the last nine.
"When you just don't feel like anything is going your way, you want to try to find a little door to get into," Sharapova said. "It's always that little part that's the toughest."
Sharapova lost in the semifinals at Roland Garros in 2011, then won the title a year later to complete a career Grand Slam. She lost in last year's final to Serena Williams.
"It was so tough losing in the final last year, being the defending champion," Sharapova said. "This year, to come back, I have the extra motivation to go further, and to be back on (this) stage is a really nice feeling."
Sharapova will face Eugenie Bouchard in the semifinals. The 18th-seeded Canadian beat Carla Suarez Navarro of Spain 7-6 (4), 2-6, 7-5.
Bouchard is playing in only her fifth Grand Slam tournament, but she is already into her second major semifinal. She also reached the last four at the Australian Open in January.
Muguruza, who was playing in a Grand Slam quarterfinal for the first time in her career, eliminated Williams in the second round.
"The younger generation is ambitious," said Sharapova, who beat Bouchard in the second round at the French Open last year. "That's why they are in these stages of the tournament."
Djokovic beat eighth-seeded Milos Raonic of Canada 7-5, 7-6 (5), 6-4 to reach the semifinals at Roland Garros for the sixth time. He has only played in one final, however, losing to Rafael Nadal in 2012.
Gulbis, who defeated Roger Federer in the fourth round, reached his first career Grand Slam semifinal by beating sixth-seeded Tomas Berdych of the Czech Republic 6-3, 6-2, 6-4.
Gulbis is competing at his 27th major tournament, but this is only the third time he has advanced past the third round. He reached the quarterfinals at the French Open in 2008, but lost to Djokovic.
On another overcast day at Roland Garros, Sharapova quickly fell behind 4-0, losing 15 of the first 20 points. But she then started to land her shots, and her serves, with more consistency.
Sharapova finally held her serve in the fifth game, but she was broken again, this time at love, to lose the first set.
"I didn't do much in the first set to hurt her. She was doing many things well," Sharapova said. "I still had a fair bit of time to change things around. Little by little, I started playing a bit better."
At 1-1 in the second set, Sharapova finally broke, with some help from Muguruza.
The unseeded Spaniard, ranked 35th in the world, double-faulted twice in a row to give Sharapova her second break point of the match. The tall Russian converted when Muguruza sent a backhand long.
Although Sharapova was broken again in the set, again with a double fault, she started to hold serve more easily while giving Muguruza more trouble while receiving.
By the time the third set started, Sharapova was moving Muguruza all over the court, landing her forehands and backhands easily.
The only hiccup came in the fourth game, when Muguruza had five break points but couldn't convert any of them.
"That was one of the most important games," Sharapova said. "After I won that game, I certainly gained more confidence."
Like Sharapova, Bouchard also struggled early in her match, trailing Suarez Navarro 5-2 before taking the first set. In the third, Bouchard fell behind 4-1, but won 12 straight points to get to 4-4.
In the final game of the match, the chair umpire twice called for points to be replayed. Bouchard won both replays, with the second one giving her match point.
On the third match point, Suarez Navarro hit a backhand into the net
"I am going to rest a lot now. I'm quite tired, but it's OK," Bouchard said. "I'm really excited to be in Paris for two more days and to play in the semifinals at Roland Garros."