MELBOURNE, Australia — Stan Wawrinka left it as late as possible before deciding his knee might just be good enough to get him through the Australian Open, site of his Grand Slam breakthrough.

The 2014 champion clearly wasn't fit enough against No. 97-ranked Tennys Sandgren, though, and made his earliest exit in a decade — 6-2, 6-1, 6-4 in the second round.

After a searing day at Melbourne Park when the temperature hit 40 Celsius (104 Fahrenheit), and tempers were tested, No. 9 Wawrinka was one of three seeded players to fall in the men's draw.

Wimbledon champion and No. 3-ranked Garbine Muguruza was one of five seeded players to lose in the women's side on Day 4.

Six-time champion Novak Djokovic survived the round, but complained of the "brutal" heat in a four-set win over an ailing Gael Monfils that extended his record to 15-0 in their career head-to-heads.

Djokovic is playing his first tournament since Wimbledon, and has remodeled his serve to take some load of his injured right elbow.

Warwinka was playing at night when the temperature dropped a few degrees but appeared lethargic and generally didn't threaten 26-year-old Sandgren, who had never beaten a top 10 player and now has two wins at Grand Slam tournaments.

Sandgren appeared to be slightly awkward at how lopsided it was against Wawrinka, who has a clearly visible scar running down his left knee.

"I know it's tough with a former champion," he said. "I wish him the best on his road to recovery."

Muguruza also struggled with her fitness in the build up to the Australian Open, retiring from a game at the Brisbane International because of cramping, and withdrawing ahead of the Sydney International quarterfinals because of a thigh problem.

Blisters from the hot court surface didn't help her in a 7-6 (1), 6-4 loss to No. 88-ranked Hsieh Su-wei, who has been No. 1 in doubles but had a career-high ranking of 23rd in singles.

That left only Maria Sharapova, Aneglique Kerber and French Open champion Jelena Ostapenko as Grand Slam winners in the women's draw.

Sharapova and Kerber meet in the third round, meaning only one of the remaining Australian Open winners can reach the second week.

Sharapova, the 2008 Australian Open winner, beat No. 14-seeded Anastasija Sevastova 6-1, 7-6 (4) to avenge a fourth-round loss to her in last year's U.S. Open. That was Sharapova's first major since returning from a 15-month doping ban following a failed test here in 2016.

Kerber, the 2016 champion, had a 6-4, 6-1 win over Donna Vekic before the Margaret Court Arena crowd sang "Happy Birthday" to celebrate her 30th birthday.

"Happy to be playing tennis again like 2016," said Kerber, who has won 11 straight matches.

Still aiming for a first major, top-ranked Simona Halep, a two-time French Open finalist, held off 2014 Wimbledon finalist Eugenie Bouchard 6-2, 6-2. Halep next plays Lauren Davis.

Ninth-seeded Johanna Konta lost in straight sets to U.S. lucky loser Bernarda Pera, who is ranked No. 123-ranked and making her Grand Slam debut. She didn't even know she had a spot in the main draw until Margarita Gasparyan withdrew.

"It feels amazing. I was ready to leave on Monday and then they told me I'm in," said Pera, who next plays No. 20 Barbora Strycova.

U.S. Open finalist Madison Keys opened with four straight aces and won the first 11 games in a 6-0, 6-1 win over No. 92-ranked Ekaterina Alexandrova.

Also advancing were No. 6 Karolina Pliskova, No. 8 Caroline Garcia, No. 26 Agnieszka Radwanska, No. 28 Ash Barty and No. 29 Lucie Safarova.

The heat peaked during Djokovic's 4-6, 6-3, 6-1, 6-3 win over Monfils. Both players slouched over in the shade between points, earning warnings about time delays from the chair umpire.

The win was a relief for Djokovic, who lost in a second-round shocker here last year, but he said officials need to be more considerate about the players in the conditions.

Now seeded 14th, Djokovic needed four match points in an eight-minute last game before clinching the win against Mofils, who needed a medical timeout for heat stress and said he had trouble breathing.

"It was obvious we both suffered on the court today," Djokovic said. "Really tough conditions — brutal."

Djokovic, who won five of the six titles from 2011-2016, is a step closer to a possible meeting with fourth-seeded Alexander Zverev, who had a 6-1, 6-3, 4-6, 6-3 win over Gojowczyk.

It's supposed to be even hotter on Friday, with a forecast high of 42 Celsius (108 Fahrenheit).

No. 7 David Goffin and No. 13 Sam Querrey won't have to deal with that after their second-round losses.

Among the leading men advancing were 2009 U.S. Open champion Juan Martin del Potro, No. 19 Tomas Berdych, No. 21 Albert Ramos and No. 5 Dominic Thiem, who rallied to beat 190th-ranked American qualifier Denis Kudla 6-7 (6), 3-6, 6-3, 6-2, 6-3.