His overall victory on Friday delivered a first title in the car category for Audi.
American Honda rider Ricky Brabec won the motorcycling category for the second time, in the 46th edition of the gruelling two-week race, with Australia's Toby Price and Daniel Sanders fifth and eighth respectively.
Australia's Toby Price finished second on stage 12 for overall fifth place. (EPA PHOTO)
Spanish driver Sainz finished the 12th and final stage in Yanbu, on the Red Sea coast, with a lead of one hour, 20 minutes and 25 seconds over Belgium's Guillaume de Mevius for Overdrive Toyota.
France's Sebastien Loeb was third.
Loeb, a nine-times world rally champion who had been Sainz's biggest rival until mechanical problems ended his challenge on Thursday, won the final stage in a Prodrive Hunter for the Bahrain Raid Xtreme team.
Sainz has now won the Dakar with four different manufacturers - Volkswagen in 2010, Peugeot in 2018 and Mini in 2020 - and he did it this time without winning any of the individual stages.
Audi, who have been targeting the Dakar since 2022 and are widely expected to now focus on their new Formula One project, are the first manufacturer to win with a car powered by an electric drive train.
The Audi RS Q e-tron uses an energy converter, featuring a 2.0 litre four cylinder turbo engine, to charge the car's high-voltage battery while driving.
Argentina's Kevin Benavides was the first motorcyclist to cross the line on the final stage, hotly pursued by Price who finished second to lift one place in the overall rankings.
The rally began in 1978 as a race from Paris across the Sahara to the Senegalese capital but switched to South America in 2009 for security reasons. It moved to Saudi Arabia in 2020.