In a thrilling repeat of the 2002 final, German forward Christopher Zeller scored two goals including the winner to stun the Aussies who looked to be on their way to a world title leading by two goals.
It was the perfect ending for retiring Germany coach Bernhard Peters who is now off to coach regional football team TSG Hoffenheim.
"It was amazing the way the boys turned the match around in the second half," Peters said.
"The team showed incredible will power and I am very, very proud."
The home side scored first at the Warsteiner Hockeypark through Zeller, only for Australia to score three unanswered goals through Mark Knowles, Matthew Naylor and Troy Elder.
However, with parochial crowd support Germany fought back in fine style through goals to Moritz Fuerste to make the score 3-2, and veteran Bjoern Emmerling who leveled the scores with a reverse-stick shot looping over Kookaburra’s goal keeper Stephen Mowlam.
The superb Zeller then hit the winner as he ran into the circle and slipped the ball under Mowlam to send the 12,000-strong crowd into rapture.
German Moritz Fuerste (right) and
Australian Bevan George (left)
"If you score three goals in a World Cup final you expect to win, but to Germany's credit they just kept on coming," said Australia captain Brent Livermore.
"We felt like we had our hands on the cup at 3-1 but it just slipped away."
Australia were without key forward Jamie Dwyer, who was voted player of the tournament with the 2004 world player of the year picking up a hamstring strain in Australia’s 4-2 semi-final win over South Korea.
Earlier, the bronze medal for the tournament was won by Spain after they defeated South Korea 3-2 in extra time of the third place playoff.