Rory McIlroy predicted he would enjoy the weekend at the Dubai Desert Classic after a 66 on day two moved him firmly into contention.

The former world number one vaulted up the leaderboard into a share of fifth place, following up a steady 71 with a bogey-free round containing four birdies and an eagle.

A two-time winner of this tournament, having been champion as a 19-year-old in 2009 and again in 2015, McIlroy has happy memories and there could be more cause to celebrate come Sunday.

He moved to seven under par through 36 holes, putting him just four shots behind the leader, Justin Harding of South Africa, who added a 68 to his opening 65.

England's Tyrrell Hatton sits second on nine under after matching McIlroy's score. Nobody beat 66 in the second round, with Germany's Nicolai von Dellingshausen also making the same score, in his case atoning for an opening 77 to reach a share of 38th place.

South African Erik van Rooyen and Paraguayan Fabrizio Zanotti share second on eight under par, with McIlroy one shot back in a group that also includes England's Richard Bland, Norway's Viktor Hovland, Adrian Meronk of Poland, and the first-round leader Joachim B Hansen, who had four bogeys and four birdies in a level-par 72. Tommy Fleetwood, Lee Westwood and Paul Casey were all on six under.

McIlroy chipped in for eagle at 13, while leader Harding, who began on the back nine, holed from 183 yards at the par-four sixth.

There was satisfaction but also frustration for McIlroy after his round, as he said: "It could have been way lower. I certainly hit the ball good enough for it to be a few shots lower. I hit the ball as good as I've done in a long time, and it could have been a few better, but 66 is a good score and sets me up for a nice weekend."

McIlroy said he had been making technical alterations to his swing on the range, and added: "I thought I hit my irons a lot better today and was in control of the driver a bit better too."

To his frustration, McIlroy has not won a major since reaching four big ones in 2014, but he had two victories on the PGA Tour last year and was firmly in the hunt for the DP World Tour Championship in November until a closing 74 scuppered his chances.

The Northern Irishman tied for 12th last week at the Abu Dhabi HSBC Championship, enjoying a strong weekend after only just making the cut. This time he is in a better position from which to strike, and he likes his game at the moment.

"I think with how I ended last year, I certainly found something. I got a little bit of momentum, I won on the PGA Tour and had a really good chance to win here in Dubai at the end of last season," McIlroy said speaking to the DP World Tour website.

"But it feels good. There are so many ebbs and flows in this game and the career's so long that it's hard to compare one season to the next, and how you're feeling and how you're hitting it. But looking back on my last 12 or 14 years, the body of work is there.

"I've played well when I haven't felt so good and I've played poorly when I've felt really good. So it's just a matter of keep showing up each and every day and try your best and try to put the lowest score possible on the scorecard and move on."