MIAMI, FL, USA - No.10 seed Angelique Kerber needed three sets and almost three hours to dodge World No.125 Wang Yafan’s inspired upset bid at the Miami Open.

Finding herself just a game away from defeat in the second set, the relentless Kerber recovered emphatically to defeat the qualifier 6-7(1), 7-6(5), 6-3. With the victory, Kerber extends her excellent form into Miami, having now reached the quarterfinals or better at every tournament she’s played in 2018.

Read more: Venus knocks out defending champ Konta in Miami

“I think [Wang] played good, and for me, it was not so easy to find my game,” Kerber reflected in her post-match press. “But also, I never played against her. I had no idea what to expect. I just knew that she played good here the last few days and also few weeks.

“But for me it was not so easy, and I was just trying to fighting. I think that was the key for me, that I was really fighting for every single ball, also especially in the second set in the tiebreak when it was 5-5.”

Victory looked a long way away against Wang’s all-out assault in the first set. Kerber recovered from an early break and built up a 4-2 lead. But she couldn’t put the Chinese player away as Wang kept coming back, playing patient and smart tennis to create opportunities.

The German’s attacking game seemed to break down, and Wang was lethal on break points - converting on all four chances she created. But Kerber found a second wind in the marathon twelfth game, saving three set points to break straight back and send them into a tiebreak.

But Wang was undaunted, and closed out the tiebreak after winning six points in a row to almost completely shut out the former World No.1.

The second set was just as close, but this time it was Kerber who emerged with the edge despite flirting with defeat. Much like in the first set, Kerber roared back to erase a 0-2 deficit but couldn’t put distance between herself and Wang. They traded breaks twice to march into the tiebreak, with Wang breaking Kerber as she was trying to serve out the set.

Kerber was two points away from defeat after giving up a 3-0 lead in the tiebreak, Wang coming back to level at 3-3 and staying toe-to-toe until 5-5. But this time, it was the former No.1 who took advantage, forcing errors out of her opponent and roaring ahead to force a third set.

In contrast to the roller coaster opening two sets, which featured 12 breaks of serve in total as each player wrestled with the momentum, just one break of serve decided the third. Kerber raised her level and broke through at 3-1, dropping just four points on her own serve across the set to close out the encounter after two hours and 55 minutes.

Kerber will take on No.13 seed Sloane Stephens - who knocked out No.3 Garbiñe Muguruza in straight sets - in the next round as she seeks a spot in the semifinals.

“For me it will be a challenge,” Kerber said. “I mean, the last time I lost against her. Now I just can try again to going out there, play my best, and trying my best to give all I can to win the match.”

Kerber is bidding to become the first left-handed player to win the Miami Open since Monica Seles in 1991, and the first German to win the title here since Stefanie Graf in 1996.