Updated 2:07am 3 June 2012

Liverpool FC's Xabi Alonso scores winner to clinch Spain's third place in Confederations Cup

Khune also distinguished himself to keep out an effort from a hitherto anonymous Fernando Torres after 51 minutes.

Indeed, Del Bosque hauled off first-choice attacking duo Villa and Torres five minutes later, replacing them with David Silva and Guiza.

And the changes did, briefly, spark Spain into life with Riera shooting at Khune and Santi Cazorla firing in a blistering 20-yard effort which the keeper opted to punch over the bar.

But just as Spain were starting to look dangerous, South Africa scored.

Some neat build-up play resulted in Tshabalala escaping down the left and his cross was controlled by Mphela before he lashed the ball high into the net.

Spain rarely threatened an equaliser until Guiza came to the fore late on.

His first goal came when he turned in a Cazorla cross with his right foot, finding the bottom left-hand corner with an excellent finish.

His second goal had an element of luck about it with what appeared to be a cross to the far post clipping the upright and going in.

That looked as though it would be enough for Spain but with the final kick of the match, Mphela lashed in a spectacular 25-yard free-kick which flew past Casillas.

Both sides had chances to win it in the first period of extra time, Joan Capdevila’s cross clipping the bar while at the other end Casillas saved well from Mphela - denying the striker a hat-trick when he had had burst through - and Bernard Parker.

But it was Alonso who had the final say two minutes into the second period with a clever free-kick which finally ended the hosts’ resistance.

Share