Maria Sharapova won 6-4, 4-6, 6-3 with the roof closed on Rod Laver Arena.
Roger Federer will continue his quest for a record seventh Australian Open title against Greek 14th seed Stefanos Tsitsipas in the last 16.
Novak Djokovic defeated Jo-Wilfried Tsonga 6-3, 7-5, 6-4 in straight sets.
The pressure on the reigning French Open champion will only increase in her next round.
The Russian five-time Grand Slam champion was forced to stay up late in her second-round match.
US Open champion and fourth seed Osaka swept past Slovenia’s Tamara Zidansek 6-2, 6-4.
The 31-year-old has only conceded three games en route to round three at Melbourne Park, where she won the title in 2008.
Seventeen-time Grand Slam winner Rafael Nadal outclassed local hope Matthew Ebden 6-3, 6-2, 6-2.
Roger Federer is working towards a third successive Australian crown and a 21st major victory.
Kevin Anderson struggled with an elbow injury early in the clash and couldn’t cope with Tiafoe’s power and finesse.