Sharapova is two wins from the career milestone after her dominant 6-0, 6-3 victory to reach her second semi-final at Roland Garros.
The seventh seed ended Petkovic's hopes of becoming the first German in the last four in Paris since Steffi Graf in 1999.
Sixth seed Li became the first Chinese player to reach a French Open semi-final with an upset 7-5, 6-2 win over fourth seed Victoria Azarenka of Belarus.
She now stands just one match away from a second straight grand slam final, having lost to Kim Clijsters at the Australian Open championship match at the start of the year.
On that occasion she was the first Chinese player to have reached the final of a grand slam event.
Sharapova, a semi-finalist in 2007, was in unstoppable form in the first set, breaking in the first, third and fifth games before taking the opener 6-0 with the Russian allowing the German just seven points on her serve.
The Russian star, who needs a French Open title to become just the 10th woman to complete a career Grand Slam, hit deep, pinpoint winners off both flanks.
Petkovic, who had defeated Sharapova to reach her first grand slam quarter-final in Australia in January, was quickly 0-2 down in the second set before she stopped the rot, finally getting on the scoreboard after 51 minutes.
The 23-year-old then levelled at 2-2 with her first break of the match but Sharapova, playing with a rare freedom of movement on a surface which has caused her numerous problems in the past, clawed back the break for a 3-2 lead.
Petkovic then broke for 3-3 after a lengthy sixth game, but former world number one Sharapova, who had been a set and 1-4 down against French teenager Caroline Garcia in the second round, once again summoned her famed fighting spirit.
She retrieved the break to lead 4-3 and held for 5-3.
Sharapova went to two match points in the ninth game with another booming forehand and claimed victory when Petkovic dumped a tired forehand into the net.
Meanwhile Azarenka, the highest-ranking and, at 21, the youngest player left in the tournament, procured the first break of the match in the third game, but she gave that back immediately with a poor service game that ended in a double fault.
Li, who converted to tennis as a nine-year-old after an early grounding in badminton, saved two break points in a marathon seventh game before finally taking a 4-3 lead.
The Belarusian was being made to work hard by her Chinese opponent who varied her shots to great effect in order to pull Azarenka away from the baseline where she was able to dominate with her heavier hitting.
Those tactics worked a treat in the 12th game when she twice wrong-footed the fourth-seed to get to 0-40 and then clinched the set with a rasping backhand crosscourt drive.
The second set opened in identical fashion to the first with Azarenka breaking in the third game to take a 2-1 lead only for Li to hit back immediately with a break of her own.
The Chinese player was clearly the quicker about the court of the two players and it was footwork again that let down Azarenka in the sixth game with two unforced errors setting up a break point which Li took with a forehand passing shot down the line.
The sixth seed held serve to zero as Azarenka's confidence fell away and she finished her off in the next game, converting her third match point when the Belarusian hit a backhand wide.
- AAP/AFPTags: sport, tennis, france