The South African skipper made 227 not out for his fifth double ton while De Villiers -- dropped off the first delivery by wicket-keeper Adnan Akmal off paceman Mohammad Irfan -- was unbeaten on 157 for his 17th Test century.
The duo plundered a hapless Pakistan attack to take South Africa to 460-4 at close on the second day, giving them a big 361-run lead with three full days to play to force a series-levelling win.
Smith and De Villiers have set an all time South African record for the fifth wicket in Tests with 326, beating the previous best of 267 set by Jacques Kallis and Ashwell Prince against the West Indies at Antigua in 2005.
The experienced duo plundered Pakistan's spin-cum pace attack on Dubai stadium pitch which gave little help to the bowlers who only managed to dismiss nightwatchman Dale Steyn (seven) in the first hour.
Smith reached his fifth double hundred with a couple off spinner Zulfiqar Babar towards mid-wicket, also completing 9,000 runs in 112 Tests.
