Sydney - Novak Djokovic dropped his first set of the ATP Cup on Friday in a titanic struggle with Canada's Denis Shapovalov, surviving a scare before rallying to guide Serbia into a semi-final against Russia.
The world No 2 was made to work hard in a hot and humid Sydney by the 14th-ranked young gun before prevailing 4-6, 6-1, 7-6 (7/4).
His impressive teammate Dusan Lajovic, buoyed by a huge contingent of Serbian fans at Ken Rosewall Arena, earlier crushed world No 21 Felix Auger-Aliassime 6-4, 6-2.
"This was the closest match I have ever played against Denis. It was so close it could have gone a different way easily," said Djokovic.
"He was playing some terrific tennis and I want to give a huge round of applause and credit to him. Well done."
The win sets up a semi-final against Russia, whose two singles players - world No 5 Daniil Medvedev and the 17th ranked Karen Khachanov - are unbeaten this season.
The other last four clash will see the Nick Kyrgios-led Australia play either Belgium or Rafael Nadal's Davis Cup-winning Spain, who are on court later on Friday.
Djokovic faced Shapovalov four times last year and won each match comfortably.
But the 20-year-old is fast-improving and had already picked up a pair of top 10 wins against Stefanos Tsitsipas and Alexander Zverev at the tournament.
He came out with guns blazing, stunning Djokovic and his fans by winning the first set.
Rattled, the Serbian superstar steamrolled the Canadian in the second set, winning five games in a row as the boisterous crowd got to Shapovalov, who allowed errors to creep in.
But after a pep talk from team captain Adriano Fuorivia he returned rejuvenated.
The high-stakes third set went with serve until the ninth game when the Canadian lost his footing going for a shot to hand Djokovic a break point, then sent a forehand long to go 5-4 down.
But the drama wasn't over.
Djokovic was serving for the match and 30-0 in front when a woman was taken ill in the stands and the action was briefly halted.
The Serb threw her a bottle of cold water as medics escorted her out, but it seemed to affect his concentration and he lost the next four points as Shapovalov broke back.
They both held serve to take it to a tiebreaker and Djokovic, as he has so often done before, rose to the occasion when it mattered most.
Lajovic in the zone
World No 34 Lajovic, who has been steadily moving through the rankings and captured his first ATP title last year at Umag, was in the zone against Auger-Aliassime.
He executed his game plan clinically and was tactically spot on, successfully targeting the wayward forehand of the Canadian, who made 32 unforced errors.
"There were so many Serbian people here today they helped me relax and get that energy that I need to play like this," he said.
"Today, everything was working fine and I was feeling really myself on the court, I feel like everything is going the way it should."
Results on day eight of the inaugural ATP Cup team event in Sydney on Friday:
Serbia 3 Canada 0
Dusan Lajovic (SRB) bt Felix Auger-Aliassime (CAN) 6-4, 6-2
Novak Djokovic (SRB) bt Denis Shapovalov (CAN) 4-6, 6-1, 7-6 (7/4)
Viktor Troicki/Nikola Cacic (SRB) bt Peter Polansky/Adil Shamasdin (CAN) 6-3, 6-2