Updated

By Mark Lamport-Stokes

MARANA, Arizona (Reuters) - A superb bunker shot to within a foot of the cup at the par-three 16th summed up Rory McIlroy's day as he eked out a gritty victory in Thursday's second round of the WGC-Accenture Match Play Championship.

The amiable world number two produced crucial up-and-downs when he needed them to beat Dane Anders Hansen 3&2 on a sun-drenched afternoon at Dove Mountain's Ritz-Carlton Golf Club.

U.S. Open champion McIlroy, who would depose fellow Briton Luke Donald from the top of the rankings by winning Sunday's final, was delighted with his ability to play dogged matchplay golf without being at his best.

"It was a decent match," the 22-year-old Northern Irishman, who never trailed and sealed the win with his up-and-down for par at the 16th, told reporters. "We both didn't have our best stuff with us.

"I needed to grind out a few pars, and I won a few holes with pars. I was pretty fortunate to get up-and-downs on 15 and 16 to close the game out. I'm just happy to be through to the third round."

McIlroy, who almost holed out with his chip from below the green at the par-four 15th, will face pony-tailed Spaniard Miguel Angel Jimenez in Friday's third round when he hoped to deliver an improved performance.

"I'm confident that I can hang in there," he said. "I've hit a few loose shots, but to play the way I have the first two days and get through two matches gives me a little bit of confidence.

"I still need to go to the range and do some work, but I'm just happy to be through to the third round.

"I'm driving the ball long, and for the most part I'm finding the fairways. I missed a few iron shots left, so I'm going to go work a little bit to try and straighten that out."

Asked about the prospect of becoming world number one for the first time, McIlroy replied: "Everyone keeps telling me, so it's hard to put it out of my mind.

"It's a little bit of extra motivation this week knowing that if I can get through four more matches, I could go to the top of the world rankings which is obviously a huge moment for my career."

McIlroy, who confirmed his rich promise as a potential golfing great by winning last year's U.S. Open in record style by eight shots, is one match away from fulfilling his short-term target at Dove Mountain.

"I set myself a goal this week just to try to make the weekend for a start," said the 22-year-old, whose best Match Play Championship result was a quarter-final loss to Australian Geoff Ogilvy in 2009.

"And then see what we can do from there. I have still got one match to go until I get to the weekend and hopefully I'm able to get through that tomorrow."

(Reporting by Mark Lamport-Stokes. Editing by Patrick Johnston)