Carlos Sainz confirmed his third Dakar Rally triumph on Friday after ensuring defending champion Nasser Al-Attiyah didn't escape in the Saudi desert.

Sainz stayed within minutes of Al-Attiyah's dust on the 12th and last stage, a 167-kilometer route from Haradh to Qiddiya.

More Images
Driver Carlos Sainz, of Spain, center, is lifted by Driver St»phane Peterhansel, of France, center and left, and driver Nasser Al-Attiyah, of Qatar, center and right, at the end of stage twelve of the Dakar Rally between Haradth and Qiddiya, Saudi Arabia, Friday, Jan. 17, 2020. (AP PhotoBernat Armangue)

Carlos Sainz confirmed his third Dakar Rally triumph on Friday after ensuring defending champion Nasser Al-Attiyah didn't escape in the Saudi desert.

Driver Carlos Sainz, of Spain, center, is congratulated by Driver Stephane Peterhansel, of France, left, and driver Nasser Al-Attiyah, of Qatar, right, at the end of stage twelve of the Dakar Rally between Haradth and Qiddiya, Saudi Arabia, Friday, Jan. 17, 2020. (AP PhotoBernat Armangue)

Sainz won by six minutes over Al-Attiyah, and 10 minutes over Mini teammate Stephane Peterhansel. The trio, who share 19 Dakar wins, had been vying for the lead among themselves since Stage 4. Sainz led from Stage 3.

Driver Carlos Sainz, of Spain, celebrates at the end of stage twelve of the Dakar Rally between Haradth and Qiddiya, Saudi Arabia, Friday, Jan. 17, 2020. Sainz, 57, won a third Dakar Rally (AP PhotoBernat Armangue)

"We did a good job to finish second even though we wanted to win," Qatar's Al-Attiyah said. "We made two or three mistakes along the way and had loads of punctures, but I'm rather happy. I'm coming back to win next year. I just needed a bit more luck."

Ricky Brabec of United States, right, talks with Toby Price of Australia before the start of stage twelve of the Dakar Rally between Haradth and Qiddiya, Saudi Arabia, Friday, Jan. 17, 2020. (AP PhotoBernat Armangue)

Former Formula One champion Fernando Alonso finished 13th on his first Dakar.

Ricky Brabec of United States rides his Honda motorbike warms up before the start of stage twelve of the Dakar Rally between Haradth and Qiddiya, Saudi Arabia, Friday, Jan. 17, 2020. (AP PhotoBernat Armangue)

Brabec won the overall from Pablo Quintanilla of Chile by 16 minutes. Defending champion Toby Price of Australia, third on the stage, was 24 minutes back in third.

Al-Attiyah, second overall, earned his first stage win of this Dakar but Sainz finished four minutes back in sixth to secure the car title beside his victories in 2010 and 2018. All three were in different cars but with the same co-driver, Lucas Cruz.

Driver Carlos Sainz, of Spain, center, is lifted by Driver St»phane Peterhansel, of France, center and left, and driver Nasser Al-Attiyah, of Qatar, center and right, at the end of stage twelve of the Dakar Rally between Haradth and Qiddiya, Saudi Arabia, Friday, Jan. 17, 2020. (AP PhotoBernat Armangue)

Driver Carlos Sainz, of Spain, center, is lifted by Driver St»phane Peterhansel, of France, center and left, and driver Nasser Al-Attiyah, of Qatar, center and right, at the end of stage twelve of the Dakar Rally between Haradth and Qiddiya, Saudi Arabia, Friday, Jan. 17, 2020. (AP PhotoBernat Armangue)

Sainz won by six minutes over Al-Attiyah, and 10 minutes over Mini teammate Stephane Peterhansel. The trio, who share 19 Dakar wins, had been vying for the lead among themselves since Stage 4. Sainz led from Stage 3.

"I feel very happy," Sainz said. “There's a lot of effort behind this. A lot of training, practice, physically, with the team. ... We started winning this Dakar on day one and we have gone flat out from the beginning.”

The Spaniard's lead was reduced to 24 seconds by Tuesday, but navigation errors by Al-Attiyah and Peterhansel on Wednesday gave Sainz an 18-minute buffer he used to cruise to the end.

Driver Carlos Sainz, of Spain, center, is congratulated by Driver Stephane Peterhansel, of France, left, and driver Nasser Al-Attiyah, of Qatar, right, at the end of stage twelve of the Dakar Rally between Haradth and Qiddiya, Saudi Arabia, Friday, Jan. 17, 2020. (AP PhotoBernat Armangue)

Driver Carlos Sainz, of Spain, center, is congratulated by Driver Stephane Peterhansel, of France, left, and driver Nasser Al-Attiyah, of Qatar, right, at the end of stage twelve of the Dakar Rally between Haradth and Qiddiya, Saudi Arabia, Friday, Jan. 17, 2020. (AP PhotoBernat Armangue)

"We did a good job to finish second even though we wanted to win," Qatar's Al-Attiyah said. "We made two or three mistakes along the way and had loads of punctures, but I'm rather happy. I'm coming back to win next year. I just needed a bit more luck."

Peterhansel completed his 31st Dakar on the podium for the 16th time. The Frenchman has won it a record 13 times, and added four stage wins to extend that record to 80.

"The four specials are a nice consolation prize, it's always nice to win," Peterhansel said. "It proves we've still got the mojo and raw speed."

Driver Carlos Sainz, of Spain, celebrates at the end of stage twelve of the Dakar Rally between Haradth and Qiddiya, Saudi Arabia, Friday, Jan. 17, 2020. Sainz, 57, won a third Dakar Rally (AP PhotoBernat Armangue)

Driver Carlos Sainz, of Spain, celebrates at the end of stage twelve of the Dakar Rally between Haradth and Qiddiya, Saudi Arabia, Friday, Jan. 17, 2020. Sainz, 57, won a third Dakar Rally (AP PhotoBernat Armangue)

Former Formula One champion Fernando Alonso finished 13th on his first Dakar.

Motorbike rider Ricky Brabec became the first American champion in Dakar history, followed soon after by compatriot Casey Currie in the SSV lightweight cars category.

Brabec on a Honda ended 18 years of KTM dominance. Rather than take it easy with a comfortable lead, he went all out to win the last stage and finished second to Jose Ignacio Cornejo of Chile by 53 seconds.

Ricky Brabec of United States, right, talks with Toby Price of Australia before the start of stage twelve of the Dakar Rally between Haradth and Qiddiya, Saudi Arabia, Friday, Jan. 17, 2020. (AP PhotoBernat Armangue)

Ricky Brabec of United States, right, talks with Toby Price of Australia before the start of stage twelve of the Dakar Rally between Haradth and Qiddiya, Saudi Arabia, Friday, Jan. 17, 2020. (AP PhotoBernat Armangue)

Brabec won the overall from Pablo Quintanilla of Chile by 16 minutes. Defending champion Toby Price of Australia, third on the stage, was 24 minutes back in third.

"It's my fifth Dakar, my second time finishing … I woke up this morning just happy to ride the last day. And we're here. We won!" Brabec said. "We had to be smart and focused every day. There's no top guy on the (Honda) team, we all work together, we're a family. We all won."

More AP sports: https://apnews.com/apf-sports and https://twitter.com/AP_Sports

Ricky Brabec of United States rides his Honda motorbike warms up before the start of stage twelve of the Dakar Rally between Haradth and Qiddiya, Saudi Arabia, Friday, Jan. 17, 2020. (AP PhotoBernat Armangue)

Ricky Brabec of United States rides his Honda motorbike warms up before the start of stage twelve of the Dakar Rally between Haradth and Qiddiya, Saudi Arabia, Friday, Jan. 17, 2020. (AP PhotoBernat Armangue)