Australia had previously won three silvers and three bronzes but the gold had remained elusive until young striker Jamie Dwyer fired in a penalty corner in extra time.
The Australians came to Athens determined to get their first gold and came out fighting for all they were worth in the final. But it was the Netherlands, the defending champions, who scored first with a stunning run from Ronald Brouwer.
At the start of the second half, Travis Brooks knocked in an equaliser but nobody else found goal until towards the end of the first half of extra time when Australia won a penalty.
Dwyer, one of the most impressive scorers in the tournament, calmly ran up and hammered the ball into the net, putting Australia on top of the podium for the first time.
Meanwhile, Bjoern Michel scored a golden goal in his last international match as world champions, Germany, overcame Spain 4-3 to win the Olympic men's field hockey bronze medal here on Friday.
Michel scored the winner five minutes before the end of extra-time in a thrilling play-off where both teams were locked 3-3 at the end of regulation time.
"I did not want to leave hockey without an Olympic medal, so this is indeed wonderful that I helped the team win," said the 30-year-old veteran of 333 matches from Munich.
"We were a bit disappointed not having made the final, but this win will help us get over that."
Germany, who won the 2002 World Cup in Malaysia, improved upon their fifth-place finish at the Sydney Olympics four years ago.
Spain, silver-medallists at Atlanta in 1996 who slipped to ninth at Sydney, finished fourth in the 12-nation competition.
"It is very difficult to accept that we lost out on an Olympic medal in extra-time," said Spain's Dutch coach Maurits Hendriks.
"We were not lucky at all. Hopefully we will wake up tomorrow and see the game in perspective. But I can't do that now."
Spain had a chance to take the lead in the 20th minute when Albert Sala beat German goalkeeper Clemens Arnold, but only managed to push wide off the post. Three minutes later, Germany scored the first goal when Sascha Reinelt broke through from the left and centered to an unmarked Michel, who deflected the ball in.
Spain drew level four minutes before half-time as Christoph Eimer fouled Pol Amat inside the circle and umpire Henrik Ehlers of Denmark awarded a penalty stroke.
The Germans replaced Arnold with reserve goalkeeper Christian Schulte for the stroke, but the change made no difference as Santiago Freixa pushed in.
Spain were granted a second penalty stroke soon after the interval - this time by umpire Murray Grime of Australia - when Arnold squatted on the ball in trying to prevent Freixa from scoring.
Arnold decided to defend the stroke himself this time but failed to prevent Eduardo Tubau from scoring his seventh goal in the competition.
Spain's 2-1 lead was followed by three goals in a four-minute burst which made it 3-3.
Germany made it 2-2 in the 45th when an unmarked Eike Duckwitz beat Spanish goalkeeper Bernardino Herrera with a shot from the top of the circle.
Spain went ahead two minutes later as Tubau found the target from a narrow angle to the right, taking his overall tally to eight.
Germany, however, equalised for the second time in the next 45 seconds when Bjoern Emmerling pushed in a pass from Eimer.
German captain Florian Kunz wasted a penalty corner in extra-time, before Michel won his side the match and the bronze medal.