Peterhansel, driving a Mini, was a three-times car winner and six-times motorcycle champion of the gruelling rally but it was his first victory since it moved to South America in 2009.
The Frenchman, who went into the final stage with a 43-minute lead over closest rival Nani Roma of Spain, finished 10th on the special, 3min12 off American Robby Gordon's pace.
HERE COMES GINIEL...
Peterhansel covered the 8400km event, of which more than half was timed specials, from Mar del Plata in Argentina to Lima in Peru in 38hr54min46, with team mate Roma 41min56 behind and South African Toyota driver Giniel De Villiers third by 1hr13min25.
De Villiers and co-driver Dirk von Zitzewitz led the last real stage of the 2012 Dakar until confusion at a way point caused them to slip back to second for the day but cementing their third place overall.
Zitzewitz explained: “We were on kilometre240 where there was supposed to be a way point but it did not come up. We could see bike tracks to the west in that direction. We saw a helicopter had landed there, at a big drop-off that was not on the road book – because we weren't supposed to be there.
SAFE WITH THE BIKES TITLE: French rider Cyril Despres (left) celebrates with Portuguese team mate Ruben Faria (12th overall) after winning the 2012 Dakar Rally motorcycle category at the end in Sarapampa, Peru. Image" AFP
Alvarez stormed home fifth while Duncan Vos and Rob Howie turned their number 31 starting position into an 18th place.
De Villiers on the podium and the three Toyotas in the top 10 would have been unthinkable three months ago when the South African Imperial team got the go-ahead for the project
For tonight, the crew is preparing the cars for a last dash in the sand and to packing the trucks for the trip home.
De Villiers’ Toyota team mate Duncan Vos was 15th.
Peterhansel said after the race: "When you think of how hard it is to win a Dakar, it's incredible that I've been able to win 10 of them. I've been waiting for five years to win again! To take the victory in South America is a huge relief, among my best triumphs.
"Moreover, the race was very close during the first week and there was always a lot of pressure. I don't know what I could do to go one better! Beating this record is going to be difficult... for the others!
"This race is stressful, exciting and fascinating. It's also very rewarding at the end. Now I'm going to party with the entire team and then we'll see. My finest victory will always be my first win in the motorcycle category but this one has something special to it.
PODIUM FOR SOUTH AFRICA: Giniel de Villiers and his SA-built Toyota Hilux on the way to third place in the 2012 Dakar Rally. Image: AFP
Despres (KTM) came through the stage unscathed to finish ahead of Marc Coma, whose wrong turn on Saturday handed his rival a clear run to the title and his fourth win
The day's motorcycle stage was won by Dutchman Pal Ullevalseter. Despres clocked 43hr28min11 in the overall timings, 53min20 ahead of Coma, with Yamaha rider Helder Rodrigues of Portugal third at 1hr11min17.
Despres said: “This was without doubt the toughest Dakar I've raced. It was difficult physically but even more so psychologically. Challenging yourself every morning and fighting on the course takes its toll on your mind.
"I've done about 90 rallies but this was the one in which I had to fight the hardest. Today will leave its mark on me." - AFP and contributors
Dakar Rally results on Sunday after the 14th and final stage from Pisco to Lima over 254km (special 29km)
Cars
Stage
1 Robby Gordon (USA/Hummer) 22min43
2 Ricardo Leal Dos Santos (POR/Mini) +21sec
3 Krzyscztof Holowczyx (POL/Mini) +38sec
4 Giniel de Villiers (RSA/Toyota) +1min28
5 Carlos Sousa (POR/Great Wall) +1min36
6 Lucio Alvarez (ARG/Toyota) +2min01
7 Leonid Novitskiy (RUS/Mini) +2min10
8 Nani Roma (ESP/Mini) +2min11
9 Bernhard Ten Brink (NED/Mitsubishi) +2min49
10 Stephane Peterhansel (FRA/Mini) +3min12
Final standings
1 Stephane Peterhansel (FRA/Mini) 38hr54min46
2 Nani Roma (ESP/Mini) +41min56
3 Giniel de Villiers (RSA/Toyota) +1hr13min25
4 Leonid Novitskiy (RUS/Mini) +2hr11min54
5 Robby Gordon (USA/Hummer) +2hr16min53
6 Lucio Alvarez (ARG/Toyota) +4hr05min52
7 Carlos Sousa (POR/Great Wall) +4hr30min24
8 Ricardo Leal Dos Santos (POR/Mini) +5hr03min18
9 Bernhar Ten Brinke (NED/Mitsubishi) +5hr11min18
10 Krzysztof Holowczyc (POL/Mini) +6hr59min38
Bikes
Stage
1 Pal Ullevalseter (NOR/KTM) 22min26
2 Marc Coma (ESP/KTM) +18
3 Stefan Svitko (SVK/KTM) +1min43
4 Gerard Farres Guell (ESP/KTM) +2min01
5 Alessandro Botturi (ITA/KTM) +2min11
6 Olivier Pain (FRA/Yamaha) +2min55
7 Jordi Viladoms (ESP/KTM) +3min35
8 Helder Rodrigues (POR/Yamaha) +3min41
9 Juan Barreda Bort (ESP/Husqvarna) +3min44
10 Cyril Despres (FRA/KTM) +3min51
Final standings
1 Cyril Despres (FRA/KTM) 43hr28min11
2 Marc Coma (ESP/KTM) +at 53min20
3 Helder Rodrigues (POR/Yamaha) +1hr 11min 17sec
4 Jordi Viladoms (ESP/KTM) +1hr40min56
5 Stefan Svitko (SVK/KTM) +1hr47min28
6 Pal Ullevalseter (NOR/KTM) +2hr11min56
7 Gérard Farres Guell (ESP/KTM) +2hr14min22
8 Alessandro Botturi (ITA/KTM) +2hr59min04
9 Olivier Pain (FRA/Yamaha) +3hr17min50
10 Felipe Zanol (BRA/KTM) +3hr25min56