Naomi Osaka advanced to the round of 16 at the Madrid Open for the first time with a hard-fought win over Spanish wildcard Sara Sorribes Tormo on Tuesday.

The world No. 1 from Japan withstood a tough challenge from her 73rd-ranked opponent in the first two sets before storming home to win 7-6(5), 3-6, 6-0 in two hours, 35 minutes.

Osaka had beaten Sorribes Tormo in straight sets in their only previous encounter, at Wimbledon in 2017. But the Spaniard put up a much tougher fight with home court, pushing the top seed to a tie-breaker in the first before winning the second.

Osaka had a straight-sets victory in her sights after going up 2-0 in the second, but Sorribes Tormo broke back and then capitalized on unforced errors to take control of the set.

The reigning U.S. Open and Australian Open champion took her play up a gear in the deciding set, however, exposing the gulf in class between the two players.

Osaka beat Dominika Cibulkova 6-2, 7-6(6) in the opening round. The match against the 32nd-ranked Slovak was her first since withdrawing from April's Porsche Tennis Grand Prix semifinal due to abdominal pain.

Osaka will face Belarus' Aliaksandra Sasnovich in the round of 16.

(Naomi Osaka (L) and Sara Sorribes Tormo)