(CNN) -- Pablo Martin survived a near disastrous final hole to take a two-shot lead over home favorite Ernie Els into the final round of the Alfred Dunhill Championship in South Africa.
Former world No. 1 Els trimmed the Spaniard's halfway advantage by two strokes as he carded a three-under-par 69 in Saturday's third round to be tied for second with compatriot Charl Schwartzel on 12-under 204.
Martin, the first amateur to win on the European Tour two years ago, looked set to throw his lead away after following a double-bogey at the 14th hole with a wild approach that flew past the green on 18.
But the 23-year-old was relieved to see the ball run over a narrow bridge and stay out of the water after rebounding off rocks at the Leopard Creek course. He was able to save par despite a weak chip back, and signed for a 71.
"It was tense for me at the beginning," he told the European Tour's official Web site.
"It was the first time I have played with Ernie, and there was the issue of the crowds too. But after a while I started to hit some good shots and I enjoyed the day."
The 40-year-old Els, who won the tournament in 2005 but threw it away with an eight on the last hole two years ago, had a mixed day as he carded four birdies, four bogeys and a double-bogey in his first 11 holes.
But the "Big Easy" birdied five of his last six holes, including the 18th for the third successive day, to give himself a good chance of his first win since March 2008 -- on the U.S. PGA Tour -- and the first title of the 2009-10 European Tour campaign.
"That was a little wild. At least there was not a shortage of birdies," Els said.
"What was I, eight behind him, and I've seen big swings in the past on the back nine and that's why this tournament is so exciting.
"I was missing very short putts. I felt my stance was a little closed, and when I missed a two-footer for birdie on 14, I said to my caddie Simon that I was going to open out a bit, and I got a little run of good putts going."
Schwartzel, who won the tournament in 2004, carded 68 as he and Els ended the day a shot ahead of South Africa's Jacques Blaauw (66) and Irishmen Damien McGrane (68) and Gareth Maybin (67).
In-form Italian Edoardo Molinari, seeking a fifth victory in his last seven starts and a place in next April's Masters alongside his brother Francesco, with whom he won the World Cup title, dropped from joint second to 12th with a 72.
Kim took the lead in the second round and went into the final 18 holes three strokes ahead, but needed to hold off the American's late charge.
Kim birdied her final hole to card 68 after Wie, who had been second after 36 holes, surged back up the leaderboard with a 65 to finish runner-up in the European Ladies' Tour event.
Wie's brave effort ended when she hit the water hazard at 18, but she still managed to save par.