Driving a Mini, Al-Attiyah had claimed victory on Sunday only to be stripped of his success for speeding -- clocking 68km/h in a section limited to 50km/h -- and earning a two-minute penalty that saw him relegated to seventh place.
But the Qatari, the 2011 champion, put on a masterful display Monday to finish eight and a half minutes clear of South Africa's Giniel de Villiers to take the overall lead following the 518km stage from Villa Carlos Paz to San Juan.
De Villiers's Toyota team-mate Bernhard Ten Brinke was second at more than 10 minutes behind and those two now hold the same positions in the overall standings.
Al-Attiyah said he felt winning this stage had been key to his overall hopes.
"We won the stage. This was a big thing today. This is the key of this Dakar. Now we can go calmly until the rest day," he said.
"For the marathon day we can go really easily, but we will try every day to be like this. It was a plan today because we studied the stage very well."
Veteran Peugeot drivers Carlos Sainz and Staphane Peterhansel, both former winners, struggled for the second day in a row, the first losing more than 26 minutes and the second much further behind.
Signup to our newsletter and follow us on Facebook and Twitter!
Defending champion Nani Roma is already out of contention after the Spaniard broke down in his Mini on Sunday and had to be towed home, losing more than six hours.
In the motorbike section Spain's Joan Barreda Bort also moved into the overall lead by taking victory on the second stage.
"I am really happy. Today was amazing. It was really hard, really tough in the last part of the special with a lot of tracks and a lot of bumps and it was so physical," said Barreda Bort.
"But today was one of these days where it is important to get to the finish and we've got here so we are really happy. I was alone in some parts, but the most important was to remain calm over the first kilometres and finally we did a really good job."
He finished 6min 13sec ahead of his Honda teammate Paulo Goncalves with fellow Spaniard Ruben Faria third on a KTM at 9min 16sec.
Reigning champion Marc Coma, another Spaniard riding a KTM, finished eighth at more than 12min and is now down in sixth place at a similar distance overall.
Briton Sam Sunderland, who won Sunday's opening stage, got lost and didn't finish amongst the top 50 on Monday.
This year's rally features a gruelling 9,000km trek through Argentina, Chile and Bolivia before arriving back in Buenos Aires for a January 17 finish.
This year's event, the seventh in South America since its enforced transfer for security reasons from Africa, is the 37th of all time.