Andy Murray's hopes of a first title of 2017 ended in disappointment as he suffered a dramatic three-set defeat to Novak Djokovic in the final of the Qatar Open.

Defending champion Djokovic appeared to be heading for a straight sets win in Doha but Murray saved three match points before taking the tie to a decider.

The Scot had the first opportunity to break in the final set but he failed to take it and then could not hold his subsequent service game as his opponent dug in to put himself on course for a 6-3 5-7 6-4 success in a match which lasted almost three hours.

Saturday's final was the first meeting between the two players since Murray had overtaken his long-term rival to become world number one - and both began in aggressive fashion.

It was Murray who had the first chance to break but the impressive Djokovic, who required treatment for a bleeding finger at 30-30 in the third game, shrugged off his minor injury to deny his opponent. The Serb then won four points in a row to come from 40-15 down in the eighth game and take Murray's serve, before clinching the opening set.

Djokovic, who saved five match points in his thrilling semi-final win over Fernando Verdasco, then looked set to wrap up the match after breaking Murray again in the second as he built a 5-3 lead.

Murray has never beaten the Serb in 19 matches when he had dropped the opening set (Getty)

But the world number two was given a taste of his own medicine as Murray showed superb resilience to stay in the match and win four successive games to level the contest at one set all.

Murray had never beaten the Serb in 19 matches when he had dropped the opening set but it seemed the momentum could be with him as he looked to end that record.

Djokovic, however, found an extra gear and secured the only break of the deciding set in the seventh game to ensure he retained the trophy.

Murray told Eurosport 2: "It was a tough one to lose, but a great way to start the year. I think it was high-level tennis. Some of the points were physically tough, but a great way to start the new year playing like that and I look forward to the next few weeks. I've had a fantastic week here, I've really enjoyed it."

Champion Djokovic said: "(It was) definitely one of the best ways to start the year. After saving five match points and winning yesterday's semi-final, I had three or four match points in the second set.

"He turned it around, and I thought 'wow, I hope this is not payback time'. All the way to the last shot you never know with Andy so it's no strange occurrence for both of us to play three sets for three hours.

"It's a very physical battle, we're both going to need a little bit of time to recover from that and get ready for Melbourne (Australian Open). It means to me a lot because in the last three months of 2016, I hadn't felt that confident on the court, I didn't play so consistent.

"To start off the year with a win against number one in the world and your biggest rival is a dream start so I'm hoping I can get the best out of it."