The four-time defending champion has only lost one of his last 21 matches at the O2 Arena and is guaranteed to finish top of the Ivan Lendl group after his 7-6 (8/6) 7-6 (7/5) victory.

It was certainly not straightforward for Djokovic, who again had lapses and had to save a set point in the second set, but victory put the pressure back on Andy Murray in their world number one battle.

The Serbian said: "It was a very close match. I think very few points separated us. It really could have gone either way.

"I was fortunate to get through the first set tie-break. I was down very early in both tie-breaks. But I just managed to stay committed and put pressure on his second serves.

"I should have done my job earlier, to be honest. I'm not very pleased to drop my serve twice against Milos, especially the second time. I was 4-3, 30-0, then just four pretty bad unforced errors.

"But in general, this definitely can serve as a great wind in the back for the next matches to come."

Canada's Milos Raonic has had a good year but came up short (Image: Action Images via Reuters / Tony O'Brien)

Raonic now faces a straight fight with Dominic Thiem, a 6-3 1-6 6-4 winner over Gael Monfils earlier, for the second semi-final place when they meet on Thursday.

The fourth seed needed to win in straight sets to book his passage through on Tuesday night, which, considering he had won just one set in seven previous meetings, was asking a lot.

At their match in Indian Wells in March, the Canadian managed only two games, but that was against the all-conquering Djokovic.

The question was whether that Djokovic would show up at the O2 Arena or the distinctly less threatening version of the last few months.

The 29-year-old has appeared ill at ease on and off the court, and his victory against Thiem on Sunday was overshadowed by a terse exchange with a journalist in the press conference.

Djokovic insisted he does not feel vulnerable, and Raonic did not detect too many differences in the Serbian's game.

"He's pretty much where he's always been," said Raonic. "Sometimes he slips up one or two points, sometimes he lets it be three points now. I think that's the only difference. Before it would be very rarely you would see two successive poor points from him."

Djokovic, meanwhile, has been relaxing away from the court by spending time with two-year-old son Stefan, and Tuesday morning's activity was a trip to Hyde Park.

The 29-year-old said: "We take a stride. We play with the ducks and swans, ball, playground. It keeps me relaxed. It keeps me grounded, as well. It's very important."