Djokovic battles past Hanfmann into Shanghai's last 16 in hot and humid conditions

Novak Djokovic in action in Shanghai
Novak Djokovic in action in ShanghaiALEX PLAVEVSKI / EPA / Profimedia

Novak Djokovic said he had been "hanging by a rope" before battling through to the Shanghai Masters last 16 with a 4-6, 7-5, 6-3 win over qualifier Yannick Hanfmann on Sunday.

The 38-year-old Serb is looking to win a record-extending fifth title in Shanghai but was given a mighty scare by the 150th-ranked German.

Djokovic fired two aces to start, delighting the crowd, but soon ran into trouble as Hanfmann found his range.

The German broke in the third game and held serve after that to clinch the first set.

"I was just outplayed by a better player for a set and a half - I was hanging by a rope to stay in the match," Djokovic said.

Neither player was able to take control of a gruelling second set until a series of unforced errors from Hanfmann in the 12th game gave Djokovic the opening he needed.

Sweating in 28 °C humidity at 9:00 pm, the 24-time Grand Slam champion then broke in the fourth game of the third set as his 33-year-old opponent's precision dropped.

Cheered on by a stadium full of adoring fans, Djokovic held his resolve to take the third set after Hanfmann hit the ball out.

"I had to dig in really, really deep to come out from this match as a winner, and I think the energy and support of the crowd really got me out," Djokovic said.

Follow the Shanghai Masters with Flashscore.