Bartoli, ranked 10th in the world, had 18 double faults and was successful on just 55 percent of her first services in the 3-hour, 10-minute match. She also had her serve broken eight times.
King hit a higher percentage on her first serves (68 percent) and had just three double faults but had her serve broken nine times.
Bartoli was down 4-2 in the third set before she used a service break and held serve twice to take a 5-4 lead with her second ace. Bartoli, who had a first-round bye, won the match when King hit a forehand into the net.
Lepchenko never faced a break point and won despite making only 55 percent of her first serves.
"It was pretty difficult out there and I'm still trying to get used to the conditions and still trying to find my game," Lepchenko said. "I'm happy the way it ended up."
Lepchenko, a naturalized U.S. citizen born in Uzbekistan, took advantage of the only service break of the first set with a forehand winner for a 4-3 lead.
Scheepers double-faulted in the third game of the second set to give Lepchenko a 2-1 lead. Scheepers failed to hold her serve as Lepchenko broke again for a 4-1 lead en route to the victory.
"Once I get into the match, especially in the second set, I started to go more for my shots and started to play a lot better," Lepchenko said.
Chan Yung-jan of Taiwan moved into the quarterfinals with a 6-3, 7-6 (2) win over Britain's Heather Watson.