Australia assistant coach Colin Batch hailed the win which matched Germany’s titles in the tournament as useful preparation for the Beijing Olympic.
"It was an excellent tournament for us and great preparation for the Olympics and to find our Olympic squad," Batch said.
Australia will announce their Olympic squad on July 10.
But coach Barry Dancer admitted he now faces a selection headache.
"Selection was always going to be very, very difficult and this tournament has not made it any easier," he said. "I always anticipated that next week would be a difficult time for the players." Australia started with customary speed on the ball and long passes into space, creating early pressure on Spain’s defence.
Desmond Abbott came back from his one-match suspension and made amends by scoring. Eli Matheson hit the crossbar with the ball falling to Abbott’s backstick to tap into goal.
Xavier Ribas scored Spain’s only goal, throwing a penalty corner flick high to the left of Stephen Lambert in the Australian goal.
Spain pressured Australia until the break, however, Australia’s deep defenders Matthew Wells, Bevan George and Mark Knowles repelled every attack.
The match drifted away from Spain in the second half as Jamie Dwyer flicked high to the left of goalkeeper Francisco Cortes for Australia’s go ahead goal.
In the last 10 minutes Spain pressed in Australia’s defensive quarter which Australia broke twice to score.
Eddie Ockenden beat two defenders and Eli Matheson went one on one with Cortes and beat him with a backstick drive into the middle of the open goal for Australia to take the 4-2 win.
"There is a growing maturity in the group which was showing throughout the tournament and the last five minutes of the match was another indication of that maturity," Dancer said.
Spain coach Maurits Hendriks was critical of his side’s finishing.
"We started well and took the game to Australia in certain moments and created chances in front of goal but we did not capitalise on those chances," Hendriks said.
Hendriks however remains positive for the Olympics.
"Spain took important steps forward in this tournament. There is nothing better than playing against the other top teams in the world to prepare for the Olympic Games," Hendriks said.
Earlier Argentina drew 2-2 with the Netherlands in regular time, and won a penalty shoot-out 5-3, to take bronze for their best finish in the tournament.
Argentina’s three Vila brothers - Lucas, Rodrigo and Matias - Juan Gilardi and Lucas Cammareri all netted their penalty strokes for a perfect conversion rate after five attempts.
Ronald Brouwer, Rob Reckers and Roderick Weusthof successfully scored for the Netherlands but Robert van der Horst had his low flick to the left post blocked by Argentina goalkeeper Juan Vivaldi.
Argentina started without midfielder Juan Eduado Garreta who returned on the first flight home after his mother died overnight.
Team members wore black arm bands and held a banner during the playing of Argentina’s national anthem urging the Garreta family to be strong.
The Netherlands put their poor pool performance behind them, attacking from the start with Teun de Nooijer getting the opener before Mario Almada equalised in the middle of the first half.
Argentine defender Lucas Rey was suspended for tripping de Nooijer seven minutes before the break and the Netherlands’ Ronald Brouwer punished the transgression by scoring with a deflection into goal late in the first half.
After the break Argentina employed their counter-attack through Juan Lopez to surprise the Netherlands with a goal by Matias Paredes to equalise at 2-2.
Argentina had one last shot on goal as the hooter sounded and the match went into a scoreless Golden Goal extra time for 15 minutes after which the result was determined by a penalty stroke contest with five strokes for each team.
Earlier Germany scored twice in the last ten minutes to beat South Korea 3-1 and take fifth place. -- AFP