LONDON — 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½ 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.

“It’s tough to say what, exactly, made the difference at the end,” Muller said. “To be honest, I haven’t really realized what just happened.”

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.

But Muller’s powerful serve and crisp volleys make him what Nadal called “uncomfortable” to play. And Muller — who already owned one victory over Nadal at Wimbledon, back in the second round in 2005 — managed to pull this one out, unfazed despite allowing opportunities to pass him by.

advertisement | advertise on newsday

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.

“When you are in the fifth, against a player like him, (the outcome) just depends on a few balls,” Nadal said, shaking his head. “Actually, he was a little better than me on a few balls.”

One key: Nadal converted only 2 of 16 break points. That included going 0 for 5 in the fifth set, four in one game, and was a big reason that the No. 4-seeded Spaniard lost despite remarkable totals of 77 winners and 17 unforced errors.

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.

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. But now he heads home, while Muller’s next opponent will be 2014 U.S. Open champion Marin Cilic.

@NewsdaySports

Other men’s quarterfinals matchups: defending champion Andy Murray against Sam Querrey of the U.S., Roger Federer against Milos Raonic, 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 piece of the arena bothered Nadal so much that he held up action and 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, suggesting they wait for the next changeover to resume.

After losing two sets in the opening 75 minutes, Nadal adjusted. He stepped a little farther behind the baseline to give himself more time to react. He also fared better on his own serve, finishing 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, offering Muller his two initial match points, before erasing those with an ace and a service winner. Muller’s next two match points came at 10-9. Nadal deleted the first with a volley winner, and the second disappeared when Muller shanked a return.

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.

advertisement | advertise on newsday

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