De Villiers, dropped at nought by wicket-keeper Adnan Akmal off paceman Mohammad Irfan, made sure Pakistan paid for the lapse as he notched his 17th Test century in taking South Africa to 337-4 by tea at the Dubai stadium.
At the break Smith was unbeaten on 165, having completed his 27th hundred in Tests in the morning session, and De Villiers on 100.
The experienced duo plundered Pakistan's spin-cum pace attack on a pitch which gave little help to the bowlers. They have so far added 203 for an unbroken fifth wicket stand, increasing South Africa's lead to 238 with six wickets intact.
Smith hit spinner Saeed Ajmal for three consecutive boundaries to reach his ninth score of 150 plus. He has so far hit 11 boundaries off 276 balls.
De Villiers was more aggressive as he hit Zulfiqar Babar for his 13th boundary to reach the three-figure mark, his fourth against Pakistan. He also hit a six off Ajmal.