Defending champion Novak Djokovic rebounded from a dismal opening set to beat Mischa Zverev 3-6, 7-6 (4), 6-3 and reach the Shanghai Masters semifinals on Friday.

Djokovic was sluggish and off-target with his groundstrokes at the start, piling up 18 unforced errors in the first set to only four for Zverev, a German qualifier ranked 110th.

He started to find his game in the second set, but Zverev continued to press him with his serve-and-volley style, forcing more miscues. Djokovic didn't start to take control until the tiebreaker, which he won handily. He then got an early break in the third set and held on.

"I wasn't striking the ball very well from the beginning of the match, to be honest," Djokovic said. "I was quite flat with my feet, so he got me where he wanted to get me, and to stand still at the baseline.

"He was fighting, he was focused. He gave his best, and he was a few points from winning."

Despite his rash of unforced errors — he finished with 37, including six double faults — Djokovic remained composed. Rather than glower at his coaches in the stands or scream at himself, he smiled after his miscues and, at one point, even hummed a little song.

Djokovic has said in recent weeks he's trying to find more balance in his life and reduce some of the pressure he's felt on court this season. Part of this, he said after Friday's match, entails trying to stay calm during matches. Even sing to himself.

"It was towards the end of the match," he said of his humming. "Instead of the occasional tantrum that I used to have — I hope it's behind me — I would switch that vibration and transform it in a tune."

Djokovic, a three-time winner in Shanghai, next plays Roberto Bautista Agut in the semifinals. Bautista Agut defeated Jo-Wilfried Tsonga, last year's runner-up, 6-3, 6-4.

Second-seeded Andy Murray was playing David Goffin in another quarterfinal later Friday, while Jack Sock was taking on Gilles Simon.