With the temperatures reaching 41 Celsius, or 107 Fahrenheit, Sharapova and Knapp slugged it out on center court, Knapp's deep, heavy groundstrokes matching up nicely against Sharapova's flat, penetrating ground game - and after an hour and a half, the two players were locked at a set apiece.
Sharapova drew first blood in the third set, building a 3-1 lead, but Knapp caught up to 3-all. Sharapova went up again, 5-3, but Knapp caught up again to 5-all, even saving three match points in the 5-4 game - one with a backhand winner, another with a huge crosscourt forehand that drew an error, and the third from a Sharapova backhand into the net. Game by game, the two kept pressing forward until 8-all.
That's when Sharapova pounced one last time, getting the last break of the match and, after fighting off one last break point, closing it on her serve, 63 46 108. It lasted three hours and 28 minutes, the longest match of the tournament so far, beating Daniela Hantuchova's effort from the day before.
"There's no way of getting around the fact that the conditions were extremely difficult, and have been like that the last few days," Sharapova said. "But you're really just trying to get through the match in the best possible way. No matter how you're playing, you're trying to make it as safe as possible.
"I'm really happy to get through today. I really am. I worked really hard in the last few months and I wanted this match. I didn't play my best tennis; I didn't do many things well. But I got through it."
How will she get fresh again for her next round? "Just recovery," she said. "Make sure the body will be ready. Take it easy tomorrow. That's the beauty of a Grand Slam - you have that day in between."
And how did she feel about Knapp? "I thought she played really great tennis as the match went on. I've seen some of her matches in the past, but I thought she played really great and played very free with nothing to lose. And she played a lot tougher than maybe other matches that I have seen her play."
Despite barely missing out on her first Top 10 win, Knapp was extremely gracious in defeat.
"I'm feeling good," the Italian said. "I played a great match. It's normal you want to win at the end because it's so close, but I played a great match and I look forward to doing many matches like this.
"It gives me confidence because Maria is in the three best players in the world. I'll try to find this feeling as much as possible and play games like this all the time. It really gives me confidence."
Awaiting Sharapova in the third round will be No.25 seed Alizé Cornet, who won a marathon of her own - she rallied from 4-1 down in the third to beat Camila Giorgi in two hours and 36 minutes, 63 46 64.
Sharapova beat Cornet in their only previous meeting, though it did come via retirement.