(CNN) -- Hunter Mahan thwarted Rory McIlroy's bid to become world No. 1 by beating the Northern Irishman 2&1 in Sunday's final of the WGC Match Play Championship in Arizona.
Second-ranked McIlroy needed to claim the title to dislodge England's Luke Donald from top spot, but could find no answer to his 29-year-old U.S. opponent, who won his second World Golf Championship event.
"No question when you play a WGC event, it's the best players in the world. It's not just in the U.S. it's in the world, so this feels pretty special," said Mahan, who climbed to ninth in the rankings, making the top 10 for the first time in his career.
"It's hard to get lucky in this week, because you're going to play such great players every single round."
All square through the first five holes, Mahan dramatically turned the match his way by winning the next four holes through a mixture of brilliance and mistakes by U.S Open champion McIlroy.
The 22-year-old McIlroy chipped in for an eagle to win the par-five 11th and pulled a further hole back with a birdie at the 14th, but could make no further impression.
Mahan, who made six birdies in the final, is the first American to win the Match Play crown at Dove Mountain since Tiger Woods in 2008.
It was his fourth career victory on the PGA Tour, and capped a busy schedule of five successive tournaments -- this one requiring him to play six matches over five days, including 36 holes on the last.
McIlroy has another chance to claim the No. 1 ranking at this week's Honda Classic in Florida, where Donald will not be playing.
"I didn't have my best game with me this week, but I'm happy with how I'm playing and hopefully it won't be long before I'm winning again," he said.
"I've got two more tournaments before the Masters and that's what I'm building up to."
Earlier on Sunday, McIlroy beat Ryder Cup teammate and world No. 3 Lee Westwood 3&1 in their semifinal to end the Englishman's hopes of reclaiming top spot.
McIlroy found himself three down after four holes to his former management agency stablemate Westwood, but he staged a sterling recovery to win four of the next five.
Leading by one hole at the turn, McIlroy was never headed again and carded seven birdies in a fine victory.
Mahan started fast against his semifinal opponent Mark Wilson, winning the opening two holes.
But the all-American clash remained close throughout and Mahan had to wait until the 17th to close out a 2&1 victory.
Wilson beat Westwood 1-up in the third-place playoff.