Melbourne - Bulgaria's world No 3 Grigor Dimitrov wrestled with his serve before dousing young Russian Andrey Rublev to reach the round of 16 at the Australian Open on Friday.
Dimitrov, who needed five sets to scramble past American qualifier Mackenie McDonald in the second round, held on for a fluctuating 6-3, 4-6, 6-4, 6-4 win in just over three hours on Rod Laver Arena.
He will next face either Australia's 17th seed Nick Kyrgios or former winner Jo-Wilfried Tsonga of France for a place in the quarter-finals.
But Dimitrov is grappling with his serve and gave up 15 double faults, including an embarrassing three when he was serving for the third set.
His unrestrained joy upon winning showed his relief at finally putting Rublev away in the topsy-turvy contest.
"These are the most important matches for me when things are not working for me and I find a way," he said afterwards.
"He's a good player. He beat me at the US Open so I knew what to expect and what I had to do."
Dimitrov admitted he was not playing at his best right and needed more work on the practice court ahead of his next match.
"I might even go indoors now and try a few things," he said. "I'm feeling good physically, the heat didn't scare me at all today, so that's a good sign.
"I just need to stay calm and composed ... go with the flow a little bit."
It was a messy performance from Dimitrov with 61 unforced errors, dropping serve four times and a low percentage of points off his second serve.
Rublev, who upset him in straight sets in the second round at last year's US Open, grabbed an early break but Dimitrov responded with three straight games on the way to taking the opening set.
But Rublev rattled off four straight games to level the second set before Dimitrov won a see-sawing battle in the third and fourth sets.
Dimitrov has work ahead of him if he is to get beyond the semi-finals of a Grand Slam at this year's Australian Open after reaching the last four at Wimbledon in 2014 and in Melbourne last year.
The stylish Bulgarian claimed the biggest title of his career when he beat Belgium's David Goffin in the ATP Finals in London among his four titles in 2017 to get to his career-high ATP ranking of three.
Results from the Australian Open on Friday:
Men's singles
3rd round
Kyle Edmund (GBR) bt Nikoloz Basilashvili (GEO) 7-6 (7/0), 3-6, 4-6, 6-0, 7-5
Pablo Carreno-Busta (ESP x10) bt Gilles Muller (LUX x23) 7-6 (7/4), 4-6, 7-5, 7-5
Grigor Dimitrov (BUL x3) bt Andrey Rublev (RUS x30) 6-3, 4-6, 6-4, 6-4
Women's singles
3rd round
Petra Martic (CRO) bt Luksika Kumkhum (THA) 6-3, 3-6, 7-5
Denisa Allertova (CZE) bt Magda Linette (POL) 6-1, 6-4
Elise Mertens (BEL) bt Alize Cornet (FRA) 7-5, 6-4
Elina Svitolina (UKR x4) bt Marta Kostyuk (UKR) 6-2, 6-2
Magdalena Rybarikova (SVK x19) bt Kateryna Bondarenko (UKR) 7-5, 3-6, 6-1