Updated

First, Rafael Nadal erased a two-set deficit. Then, he erased four match points. Nadal could not, however, erase the fifth.

After digging himself out of difficult situations over and over during the course of a riveting encounter that lasted more than 4 1/2 hours, Nadal suddenly faltered, getting broken in the last game and losing to 16th-seeded Gilles Muller of Luxembourg 3-6, 4-6, 6-3, 6-4, 15-13 in the fourth round of Wimbledon on Monday.

The surprising defeat extended Nadal's drought without a quarterfinal berth at the All England Club to six years.

He has won two of his 15 Grand Slam championships at Wimbledon, and played in the final three other times, most recently in 2011. But since then, Nadal's exits at the All England Club have come in the first round (2013), second round (2012, 2015) and fourth round (2014, 2017).

All of those losses, except Monday's, came against men ranked 100th or worse. The 34-year-old Muller is not exactly a giant-killer: He had lost 22 consecutive matches against foes ranked in the top five. And he'd only reached a Grand Slam quarterfinal once before, at the 2008 U.S. Open.

Mullerwimbledon880

Gilles Muller celebrates after beating Rafael Nadal in the Round of 16 at Wimbledon Monday. (AP Photo/Tim Ireland)

But Muller managed to pull this one out, unfazed but allowing opportunities to pass him by.

Nadal served from behind throughout the final set and was twice a point from losing in its 10th game. He again was twice a point from losing in the 20th. Only when Muller got yet another chance to end it did he, when Nadal got broken by pushing a forehand long.

Nadal entered the match having won 28 consecutive completed sets in Grand Slam play, equaling his personal best and a total exceeded only twice in the Open era. He arrived at the All England Club coming off his record 10th French Open championship, and 15th major trophy overall, and seemed primed to be a factor again at the grass-court tournament.

Muller, though, presented problems. He already owned one victory over Nadal at Wimbledon, back in the second round in 2005.

That was before Nadal figured out how to bring his talents to bear on grass. From 2006-11, Nadal reached the final in five consecutive appearances at Wimbledon (he missed it in 2009 because of bad knees), winning titles in 2008 and 2010.

Muller's next opponent will be 2014 U.S. Open champion Marin Cilic.

Other men's quarterfinals matchups are defending champion Andy Murray vs. 24th-seeded Sam Querrey of the U.S., seven-time champion Roger Federer vs. 2016 runner-up Milos Raonic and 2010 runner-up Tomas Berdych against Novak Djokovic or Adrian Mannarino. The Djokovic-Mannarino fourth-rounder was postponed until Tuesday; it had been scheduled to be played on No. 1 Court after Nadal-Muller concluded.

But that duo played on and on, past 8 p.m., when the descending sun's reflection off a part of No. 1 Court bothered Nadal so much that he held up the action in the fifth set. Chair umpire Ali Nili asked spectators to stand in the way and block the rays. A few games later, Nili told fans to stop doing the wave so play could resume, suggesting they wait for the next changeover to resume.

Despite playing as cleanly as can be in the opening set -- zero unforced errors -- Nadal could not solve Muller's big serves and aggressive forays to the net for crisp volleys. There was more of the same in the second set. After only 75 minutes of play, Nadal appeared to be in serious trouble.

But Nadal adjusted. He stepped a little farther behind the baseline to give himself more time to react to Muller's power. He also began to have more success with his own serve, winding up with 23 aces, an unusually high total for Nadal and only seven fewer than Muller.

Still, things were not looking good when Nadal served while down 5-4 in the fifth set. He double-faulted to trail 15-40. On Muller's initial match point, Nadal delivered a 116 mph ace to a corner. On the next, at 30-40, he spun a 103 mph second serve at an extreme angle, drawing a forehand return into the net. Nadal's four-point, game-ending, match-saving flourish ended with a 120 mph service winner and a 121 mph ace. He celebrated with three shouts of "Come on!" and some violent fist pumps. In the stands, his girlfriend stood and punched the air and yelled, "Si!"

The match, of course, was not yet over. It would continue for 18 more games and 1 1/2 more hours.

Muller's next two match points came when he had a 10-9 lead. Nadal deleted the first with a volley winner, and the second disappeared when Muller shanked a return of a 94 mph second serve.

The fifth set alone lasted 2 hours, 15 minutes, and Nadal could not manage to complete what would have been his fourth career comeback from two sets down -- and first in a decade.

Instead, it was Muller who was able to enjoy a win that seemed to be slipping away.