O'Grady, wearing the green sprinter's jersey, chased down Frenchman Sandy Casar (Fdjeux.com) in the final climb of the day and took off solo for victory.
It was unknown territory for a sprinter in a stage that included four major climbs, including the category one, 1,156 metres Col de Sarcenas, which peaked with just 15 km to go.
The Aussie, however, handled the challenge like a true climber, with Casar finishing second and Spain's Pedro Horrillo Munoz (Quick.Step) taking third.
Not in the hunt for the stage victory, Mayo's yellow jersey was never under threat and he claimed the overall victory with a 36 seconds lead over American Tyler Hamilton.
Spain's Oscar Sevilla was third (at 1:14) while five times Tour de France champion Lance Armstrong was fourth (at 2:00).
"It's a great victory, but the win at l'Alpe de l'Huez [in last year's Tour de France] is still my most memorable. This one's great too though," Mayo said.
The 26-year-old Basque rider, second at last year's Dauphiné behind Armstrong, can now head to next month's Tour de France full of confidence.