Andy Murray pulled off the dream ending to his remarkable year to prove that in a continuing era of tennis greats he is indisputably top dog.

The script could not have been written any better as, for the first time, the battle for world number one came down to Murray against Novak Djokovic in the final match of the season.

And it was the home favourite who stamped his authority on proceedings in a commanding 6-3 6-4 victory.

READ MORE: Andy Murray: I plan to stay at the top for as long possible now that I'm Christmas No 1

With it came the ATP World Tour Finals trophy, a cheque for almost £2million and the knowledge that, after a decade of trying, he is in no one's shadow any longer.

So often Djokovic, the man born just a week later who he first played nearly 20 years ago, has been the one to break Murray's heart at the biggest moments, but not this time.

The Scot said: "It was obviously a big, big match against someone who I've played so many big matches against in my career, that would be my main rival.

"We played in all of the slam finals, Olympics, obviously here now, and a match to finish the year number one. We played in loads of Masters Series finals, as well, and are one week apart in age.

"It's obviously a very important win for me. This is a major event, as well, and one I've not done well in in the past. So it's been a great week."

When Djokovic defeated Murray to win the French Open in June and become the first man for 47 years to hold all four Grand Slam titles, it seemed inconceivable that 2016 would not belong to him.

But instead it was catalyst for a remarkable slump from the Serbian, one that Murray has taken full advantage of with an incredible second half of the season.

A second Wimbledon title and second Olympic gold have been the highlights but there have been seven other titles and unbeaten runs of 22 and now 24 matches.

In winning five matches at London's O2 Arena - he had won only eight on his previous six visits combined - he defeated the players who will finish the year ranked second, third, fourth, fifth and sixth.

It turned out that the real hard work came in his three-hour plus victories over Kei Nishikori and Milos Raonic.

Djokovic had appeared to have rediscovered his form at a venue where he had lost just one of his previous 23 matches but it turned out his veneer of confidence was paper thin.

READ MORE: Andy Murray: I plan to stay at the top for as long possible now that I'm Christmas No 1

The Serbian was a shadow of his peak self, making error after error and forcing Murray only to play solidly, which he certainly did.

Murray said: "I don't think that was one of Novak's best matches. The end of the match was exciting and dramatic but there were mistakes from both of us.

"It was obviously a good performance. You never beat a player as good as Novak if you don't play well.

"Maybe in the important moments today, I was just a little bit more solid, maybe had that extra little bit of confidence, which in the past when we played each other maybe he's had."

A 50/50 match appeared to have swung decisively in Djokovic's favour when Murray spent three hours and 38 minutes suppressing Raonic, while he breezed past Nishikori.

Murray admitted he was tired, saying: " I didn't feel great this morning. Thankfully the first seven games of the match, there were no long rallies really at all, which for us is strange.

"It wasn't really until the middle of the second set when the rallies started to get extended and longer that my legs were starting to feel it.

"That's why it became harder to close the match out, because I knew that the longer the match went, the worse I was going to feel, and probably the better he was going to play, too. I was lucky I got it finished in two sets."

Murray began to pile the pressure on in the sixth game but could not capitalise despite Djokovic missing one of the simplest shots of his career when he shanked a smash over the baseline.

The Scot broke through two games later, though, and appeared in cruise control at 4-1 in the second set.

Djokovic retrieved one of the breaks and finally began to find some penetration on his shots but he could not stop Murray and the contest was all over when the second seed missed a final backhand on the third match point.

It was his 30th unforced error, and a disappointed Djokovic said: "Always it's required from a player to come out on the court in these particular occasions, playing top guys, with his top game.

"I wasn't close to that. There was no serious chance for me to win today's match. From the very beginning we could see that. He was just a better player all in all."

Djokovic, who declined to say whether he would continue his three-year partnership with coach Boris Becker, said of his 2016: "M any highlights, many things to reflect on and be proud of. French Open is definitely on top of that list.

"I've had better seasons results-wise. But every year is an evolution for me. It's hard to expect to repeat all these things forever."

Murray now heads into a brief off-season, which will include his father Willie's wedding in Scotland, before turning his attention to trying to hold onto top spot.

He is in a great position to do so, with Djokovic having a huge amount of points to defend in the first half of the year, and winning a first Australian Open title after reaching the final five times will be his first big aim.

READ MORE: Andy Murray: I plan to stay at the top for as long possible now that I'm Christmas No 1

He said: "I would like to try and stay there, obviously. It's taken a huge effort the last five, six months to get there. I only managed to do it by one match. To repeat that again next year is going to be extremely difficult.

"The majors are what gets me working hard and what really, really motivates me. When I go away in December to train, I'm training with the Australian Open in mind."