Novak Djokovic had to fight to see off Marcos Baghdatis and reach the last 16 at Wimbledon after seeing Roger Federer cruise past David Nalbandian.
Federer swept aside the Argentine, serving brilliantly to beat his old foe 6-4 6-2 6-4 in an hour and 46 minutes.
But Djokovic, who was next on Centre Court, was given a much sterner test by Baghdatis, the Cypriot world number 30.
The second seed showed his frustration by smashing his racquet in the second set but came through 6-4 4-6 6-3 6-4.
A spirited display by Baghdatis earned the vocal backing of large sections of the crowd during a pulsating battle that lasted three hours and 15 minutes but Djokovic regained his cool, and his form, to progress to the second week.
From the start, the Serb struggled to break down his opponent, having to bide his time in the first set before striking in the ninth game when Baghdatis collapsed from 30-0 up, following a double-fault with a rash of errors and conceding the set when a forehand flew long.
Both players squandered chances to break at the start of the second set but it was Djokovic who self-destructed in the third game, double-faulting to hand the initiative to the 2006 semi-finalist.
The Serb never looked like getting back on terms for the remainder of the set, and showed his frustration after losing a thrilling rally when 3-4 down by repeatedly slamming his racquet into the turf, before Baghdatis fired down an ace to level the match.
That was the first set that Djokovic, who has only lost one match in 2011, had dropped at Wimbledon this year but he quickly put the lapse behind him. One break was enough to secure the third set and he repeated the trick in the eighth game of the fourth, coaxing two forehand errors out of Baghdatis.
Baghdatis battled on, helped by some fervent support, and came close to breaking back at 4-5 down but Djokovic eventually wrapped up victory on his third match-point.
"To pull off a win out of this match is great. I have to be happy with the way I played," a relieved Djokovic told the BBC afterwards. "He plays great on grass, his game is suited to quick surfaces and he has played very well here over years.
"The atmosphere was amazing, it was hard to concentrate, but it was a pleasure to be part of such an amazing match.
"I wasn't playing on the top of my level today but you have to take positives. I'm into fourth round, I beat a very good player and now I'll get ready for next week."
Djokovic will play French 19th seed Michael Llodra on Monday.
In comparison, Federer was almost completely untroubled as he overcame Nalbandian, who regularly beat the six-time champion in their early days on Tour.
The 29-year-old Swiss now holds an 11-8 winning record over the world number 23, who is five months younger and has been a rival since their junior days.
Nalbandian, the runner-up at Wimbledon in 2002, also won their first five meetings as seniors, including at two Grand Slams, but injuries have taken their toll in recent years.
He showed flashes of his ability in an open first set, trading breaks to level at 3-3 but Federer remained in control, edging the first set but running away with the second thanks to some thunderous forehands.
Nalbandian needed treatment on a problematic thigh at the start of the third set but battled on until he was broken in the ninth game after following a double-fault by dumping a forehand into the net.
That left Federer serving for the match, which he eventually sealed on his fourth match-point after missing a simple smash.
Federer, who will play Russian 18th seed Mikhail Youzhny next, told the BBC: "A guy who has beaten me eight times knows how to beat me again so I am very pleased to go through.
"I am playing better than last year - more confident on serve and more relaxed with my returns. But things are going to get tougher. Monday will be kind of cool when all the men play at the same time."