TOKYO (AP)—Second-seeded Caroline Wozniacki of Denmark beat Garbine Muguruza of Spain 6-4, 2-6, 6-2 on Saturday to reach the final of the Pan Pacific Open.

The U.S. Open finalist lost the first two games of the third set but took advantage of an increasingly erratic Muguruza and won when her opponent sent a forehand wide on match point.

Wozniacki, who won here in 2010, will meet third-seeded Ana Ivanovic of Serbia in Sunday's final. Ivanovic ousted top-seeded Angelique Kerber of Germany 7-5, 6-3.

Trailing 3-5, Ivanovic won 10 of the final 13 games to post her 51st WTA-level victory of the season.

"In the beginning it really took me some time to adjust to her game. It wasn't like my previous matches," Ivanovic told WTATennis.com. "But once I adjusted and got more aggressive it started to go my way, and I'm really happy with the win today because she's always such a tough and challenging opponent."

Muguruza had beaten Wozniacki in their two previous encounters, in the third round of the Australian Open in January and in Miami last year.

Wozniacki broke Muguruza's serve five times but lost hers four times in the two-and-half-hour match that featured plenty of long rallies. She faced 23 break points in all but saved 19, including all nine that she faced in the first set.

''She was playing really, really well and very aggressively,'' Wozniacki said. ''But I just kept fighting and staying in there, and I think at the end I had just a little bit more energy than she did.''

Ivanovic has won four of six prior matches with Wozniacki, including a 7-6 (5), 6-4 victory in their most recent meeting in the Monterrey semifinals earlier this season.