Wales will face South Africa and Argentina will meet the defending champions Spain in the semi-finals of what will be the last Alfred Dunhill Cup at St Andrews in its current format on Sunday.
Spain kept alive their hopes of retaining the trophy thanks to a Jose Maria Olazabal comeback. With Miguel Angel Martin beating Patrik Sjoland and Miguel Angel Jimenez losing to Per-Ulrik Johansson, both by one shot, it all rested on the bottom game.
Gronberg led by five after seven holes and was still three clear with five to go, but Olazabal fought back by covering the last five on two under to the Swede’s three over.
After bogeys at the 15th and 16th Grinberg chipped into the Road Bunker on the 17th and double-bogeyed while Olazabal escaped with a par after his drive finished six inches from the out of bounds wall adjoining the Old Course Hotel.
That was enough to claim the vital point to take Spain through to the semi-finals where they meet second seeds Argentina who also snatched victory from the jaws of defeat.
Honours were shared in the first two Nick O'Hern beating Eduardo Romero and Stephen Leaney losing to Angel Cabrera. In the deciding match Peter O'Malley was one-up on Jose Coceres with four to play, but double-bogeyed the 15th and 16th, could not better his opponent's bogey on the 17th and lost by two.
The Welsh demolished top seeds Scotland 3-0 to complete their unbeaten march through Group One. Ian Woosnam defeated Colin Montgomerie at the second extra hole, David Park beat Andrew Coltart 70-72 and Phillip Price got the better of Gary Orr 69-72. After a three-year absence Wales progressed to the last four for only the third time to give themselves the opportunity of reaching the finals for the first time.
"I think this week has shown that the Wales team can play," said Woosnam, who in the top match gave them the one point they needed when Montgomerie three-putted the 20th.
He and Montgomerie were round in one-over-par 73s - not good, but certainly quick. They played the 18 holes in just over three hours.
Price fired five birdies in the first 11 holes to hold off the challenge of Orr, while Park played the first 12 in four under and was always in command after that.
Fourth seeds South Africa produced a dramatic finish to beat fifth seeds New Zealand in the Group Two decider.
Grant Waite beat David Frost by four, Greg Turner was one-up on Retief Goosen with one to play and Michael Campbell was one-up on Ernie Els with three to go.
But Campbell bogeyed the 16th and Els produced two sublime birdies on last two hiles to win, then Goosen, having holed from nine feet on the 18th to force Turner into sudden death, saw the Kiwi miss from less than three feet. It gives the South Africans the chance to win for the third time in four years.
England finished bottom of their group after losing all three of their games to Germany and despite winning two of their three matches Ireland still did not make it through Group Two because of their 3-0 defeat to South Africa on Friday. Their scoring in the 3-0 closing win over France was the best of the day. Paul McGinley shot 67, Padraig Harrington 69 and Des Smyth 70 America were already out before their final game as well, but recovered some pride with a 2-1 victory over Japan.