The Toyota driver was quickest over the 406-kilometre timed special, the longest of the rally thus far, split in two parts by a 55-kilometre neutralised zone.
The stage marked the first half of the rally's 'marathon' leg, so-called because external assistance is forbidden and technical support crews do not accompany the competitors to Tacna – instead waiting for their return to Arequipa the day after.
X-raid Mini buggy driver Stephane Peterhansel, who ran first on the road after topping Wednesday's test, was marginally quicker than Al-Attiyah at the opening waypoint.
But the Qatari led at every split afterwards, arriving at the finish two minutes faster than the 13-time Dakar champion, with a time of three hours, 38 minutes and 49 seconds.
Peterhansel, who lags nine minutes behind Al-Attiyah in the general classification, has taken over in second place from fellow X-raid driver Yazeed Al-Rajhi, who had a troubled run.
Fellow Mini 4x4 drivers Nani Roma and Jakub Przygonski have moved up to third and fourth respectively as a result, with Al Rajhi a close fifth, now trailing Al-Attiyah by 25 minutes.
PH Sport Peugeot privateer Sebastien Loeb was a close third behind Al-Attiyah and Peterhansel for most of the day before tumbling to fifth at the very end of the stage. He now needs to make up more than 50 minutes relative to the marathon leader.
Despite the late setback, Loeb has moved up to sixth overall, his gains coming at the expense of Bernhard ten Brinke – the Dutchman giving up over two hours for repairs to his Toyota – and Mini buggy driver Cyril Despres, who was relegated to seventh place after losing close to half an hour.
Kamaz's Andrey Karginov saw off LIAZ driver Martin Macik to top the stage in the truck class, as Eduard Nikolaev retained the overall lead.
With Iveco's Federico Villagra hitting trouble, Macik now stands as the only competitor within reach of Kamaz's closely-matched leading trio - Nikolaev, Karginov and Dmitry Sotnikov.
In the SxS class, Sergey Karyakin took the stage win and the overall lead amid misfortune for erstwhile leader Chaleco Lopez.
Former quad champ Karyakin heads into Stage 5 with an 11-minute lead over Gerard Farres.
Standings after Stage 4 (Cars class, Top 10):
|1|| Nasser Al-Attiyah |
|3|| Nani Roma |
|5|| Yazeed Al-Rajhi |
|7|| Cyril Despres |