Northern Ireland's Michael Hoey birdied three of the last four holes to claim the biggest title of his career and condemn Rory McIlroy to a frustrating runner-up finish at the Alfred Dunhill Links Championship at St Andrews.
In a round that began in torrential rain, Hoey, 32, squandered his three stroke overnight lead playing the first seven holes of the final round in one over par.
But the former amateur champion regrouped to eclipse McIlroy who failed to capitalise on a brilliant outward half.
Hoey also prevailed over another major winner from Northern Ireland, Graeme McDowell.
The 2010 US Open champion had to settle for a three-under-par 69 to finish alongside Scotland's George Murray in a share of third, four shots behind the winner.
After beginning the tournament with three consecutive rounds of 66, Hoey carded a 68 to finish at a record breaking 22 under par.
But victory seemed unlikely when McIlroy hit the top of the leaderboard after a breathtaking six-under-par front nine.
The reigning US Open champion set the tone by holing from six feet for his first birdie at the second and at the secured a spectacular eagle when his approach shot spun back into the hole.
Another superb second shot set up a birdie at the sixth, before McIlroy holed from 20 and then 15 feet for birdies at the seventh and ninth holes.
McIlroy then nearly holed out his tee shot at the short 11th to set up a tap-in birdie that took him into the lead at 20 under par.
But on the closing stretch of holes, his putter ran cold as he sought more birdies and at the last he was unlucky to see his approach suck back and, with its very last roll, tumble into the infamous Valley of Sin.
By then McIlroy knew he needed a birdie because Hoey's brilliant approaches to the 15th and 16th holes had set up birdies that took into the lead.
Needing a par for victory, the champion played a delicate running shot through the Valley of Sin, setting up a fitting closing birdie to secure the £500,000 winner's cheque.
"It was slipping from me on the front nine, I was finding it hard to find a rhythm," admitted Hoey.
"I holed a good putt on 15 and then made good swings going into 16 and 17 and then by the last the pressure was off.
"It's very satisfying, I played great for four days - 22 under is by far the lowest score I have ever done.
"At the start of the week I would have said there's no way I could beat these major winners around here."
Despite his fellow countryman's win, McIlroy admitted: "Yeah it's great to see but to me, I don't care who wins now because I'm not.
"I've been very consistent, which is a good thing, but I want to get wins. It's good to be one, two, three and see all of us boys up there, I'm just obviously disappointed that it wasn't me lifting the trophy.
"I'm sure it will be a long flight to Korea in the morning thinking about it."
Tommy Fleetwood carded a final round 68 to cap the best week of the 20-year-old's career by finishing alongside Marc Warren and Louis Oosthizen in a share of fifth place at 17 under par.
There was no sustained charge from world number one Luke Donald, who ran out of steam in a closing 70 that yielded a share of ninth place, while BBC Radio 2 presenter Chris Evans won the pro-am title, playing with Nick Dougherty.