Halep finally escaped with the win as Davis returned long to set up a pair of match points, with the Romanian seed advancing when her opponent fired wide down the line.
"It was a very tough match, so long," Halep said. "I'm just happy I could stay on the court and win it -- I'm almost dead.
"For sure I'm stronger mentally now, and I could resist for every moment in the match. That makes me very happy, and I think the big win is that I could handle it."
Davis said: "I have never played a match like that where it went so long in the third set. We were both fighting our hearts out, and, I mean, every point was just super long."
Czech sixth seed Karolina Pliskova put out compatriot Lucie Safarova 7-6 (8-6), 7-5 and French eighth seed Caroline Garcia beat Alexandra Sasnovich of Belarus 6-3, 5-7, 6-2.
U.S. Open finalist Madison Keys, playing only her fifth match since the New York final she lost to Sloane Stephens, defeated Kazakh Ana Bogdan 6-3, 6-4.
In the men's draw, Alexander Zverev became the highest men's seed to exit as the No. 4 was toppled 5-7, 7-6 (7-3), 2-6, 6-3, 6-0 by South Korea's Chung Hyeon.
The 21-year-old Chung swept the final set as the frustrated Zverev, 20, trashed a racquet at a low point of the duel between the youngest players left in the draw. It was Chung's first win over a top-10 player.
"I have some figuring out to do, what happens to me in deciding moments in grand slams," Zverev said after another early exit. "It happened at Wimbledon. It happened in New York. It happened here."
Chung, who also beat the other Zverev brother, Mischa, earlier in the tournament, said: "It was a very tough match, he's a good player. We know how to play each other, I was just trying to give my 100 per cent on court.
Austrian fifth seed Dominic Thiem crushed Adrian Mannarino 6-4, 6-2, 7-5 to run his record to 7-0 over the Frenchman, reaching the second week in just over two hours with 42 winners and nine aces.
Tomas Berdych upset 12th seed Juan Martin del Potro 6-3, 6-3, 6-2 to reach the second week for the ninth time in 11 years.
Fabio Fognini beat Julien Benneteau 3-6, 6-2, 6-1, 4-6, 6-3 to join compatriot Andreas Seppi in the last 16, the first time for Italy to place two men this far in a grand slam since 1976 Roland Garros.
American Tennys Sandgren, who defeated 2014 winner Stan Wawrinka in the second round, continued to make progress, putting out German Maximilian Marterer 5-7, 6-3, 7-5, 7-6 (7-5). Hungary's Marton Fucsovics accounted for Argentine Nicolas Kicker 6-3, 6-3, 6-2.
(c)2018 Deutsche Presse-Agentur GmbH (Hamburg, Germany)
Visit Deutsche Presse-Agentur GmbH (Hamburg, Germany) at www.dpa.de/English.82.0.html
Distributed by Tribune Content Agency, LLC.