De Villiers finished in 48:10:57 after driving more than 5,600 miles through Argentina, over the Andes and into Chile.
He won the 14th and final stage from Cordoba to Buenos Aires in 1 hour, 35 minutes, 43 seconds in his Volkswagen. De Villiers defeated Miller, his Volkswagen teammate, by 8:59. Gordon drove a Hummer and finished 1:46:15 off the lead.
De Villiers won four stages en route to his first overall title. He took the lead Thursday after Carlos Sainz of Spain withdrew after a crash. De Villiers led Miller by just over two minutes heading into the final stage.
The Volkswagen win ended several years of Mitsubishi domination.
Marc Coma of Spain won his second motorbike title in 52:14:33, nearly 90 minutes ahead of Cyril Despres of France. David Fretigne of France was third.
The 30th Dakar Rally was held outside Africa for the first time. The 2008 race was canceled because of potential terrorist attacks in Mauritania.
Villarreal And Getafe Share Six Goal Thriller
Sainz wins 8th stage of Dakar Rally
Lionel Messi To Play In Argentina Friendly
De Villiers, Miller minutes apart in Dakar Rally