Serena Williams survives test from Ivanovic at Bank of the West Classic

STANFORD, Calif. (AP) — Serena Williams roared back after falling behind in the third set to beat Ana Ivanovic 2-6, 6-3, 7-5 on Friday night to reach the semifinals of the Bank of the West Classic.

The top-seeded and top-ranked Williams dropped three consecutive games to fall behind 4-3 and then ripped seven straight points to right the ship in front of a sellout crowd at Stanford.

"It wasn't very easy," Williams said. "I tried to do the things I worked on. I'm feeling really good. I'm not out of breath, so 'yeah.'"

Williams assured herself of a 200th non-consecutive week at the top of the ladder while Ivanovic will return to the top 10 for first time in over five years.

Andrea Petkovic ended Venus Williams' run in the tournament, beating the former top-ranked player 6-1, 3-6, 7-5 in the quarterfinals.

She gets a shot at Serena Williams on Saturday afternoon.

"You don't ever have the feeling you have something under control when you play either of them," Petkovic said. "They can hit so hard, and play consistently well. You always have to be on your toes."

Following a shaky start, the 25th-ranked Venus Williams picked up her game in the second set and appeared poised to take over the match.

The 18th-ranked Petkovic rallied in the third set, taking leads of 3-1 and 5-3, to beat Williams in their first meeting since Luxembourg in 2012.

"I was not as on as I was on previous days," Williams said. "I had to fight through that and I think I almost did that. But she played the last two points better."

Petkovic, making her debut in the tournament, is looking for her third title of the season. She also reached the semifinal at the French Open.

"I played one of my best games in the third set at 5-5," Petkovic said. "Before that it was a weird match. There were so many momentum changes and so many ups and downs, I felt like I played four different matches in one."

The Serena-Ana match was similar as Ivanovic dominated the first set before Williams turned it around in the second set.

The third set took on a life of its' own. Both players simply refused to go away and battled through long rallies and silly errors.

Serena served for the match at 5-4 but Ivanovic denied her. Serena broke back and used a pair of aces to take a 40-0 lead before ending it when Ivanovic's return went just wide.

Varvara Lepchenko took care of qualifier Sachia Vickery, 6-1, 6-0, to earn her 400th career win, which includes all levels.

"It was hard to play someone from the United States who I know very well," Lepchenko said. "I've practiced with her often before. I knew this match would be mentally tough but was just trying to play the best tennis I could."

"She is definitely one of the tougher lefty opponents out there, so I will have to play and fight for every single point," Lepchenko said. "I'm going to stay focused on my game and hopefully things will work out well for me."