De Villiers made an unbeaten 98 as South Africa reached 334 for six.
De Villiers and Hashim Amla, who made a sparkling 92, were the only top-order batsmen to play significant innings against a three-man Pakistan bowling attack with only two Test caps between them going into the game.
Rahat Ali and Ehsan Adil, neither of whom had taken a wicket in Test cricket before, were responsible for the first five dismissals as South Africa stumbled to 196 for five.
Left-arm Rahat, playing in his second Test, took three for 95, while new cap Adil, 19, took two for 54.
Amla looked set for his 20th Test century before edging a drive against a wide delivery from Rahat to be caught behind by wicketkeeper Sarfraz Ahmed.
He struck 13 fours in a 128-ball innings and shared partnerships of 69 for the third wicket with Faf du Plessis (29) and 79 for the fourth wicket with De Villiers.
With the South Africans missing star all-rounder Jacques Kallis because of a calf injury, De Villiers took over responsibility for batting out the day.
He shared a sixth wicket stand of 52 with Robin Peterson, who made 28 before being run out, and an unbeaten seventh-wicket partnership of 86 with Vernon Philander (45 not out).
De Villiers faced 179 balls and hit 13 fours.
"Although the pressure of having to win the series is off us, the way we played today in testing conditions was a testament to how much we want to win the game," said Amla.
"We could easily have thrown in the towel."
Amla said there was enough movement off the pitch and variable bounce to make batting difficult.
"You can't get into a rhythm," he said.
Although they produced wicket-taking deliveries, both Rahat and Adil were inconsistent and sent down enough loose deliveries for South Africa to maintain a scoring rate of close to four runs an over for much of the day.
Off-spinner Saeed Ajmal, the only experienced bowler in the side, was easily the most economical, conceding 70 runs in 26 overs.
Pakistan finished the day a bowler short after Adil limped off with what appeared to be a hamstring strain after sending down just one delivery with the second new ball.
Bowling coach Mohammad Akram said it was not certain whether he would be fit to bowl on Saturday.
Akram added that the fielding of such an inexperienced pace attack was forced on Pakistan.
"We had no choice. We have had a lot of injuries. Junaid (Khan) and Umar Gul would have been our first choices but they are injured," he said.
"Overall the bowling was okay against the number one side."
The injury to Kallis meant a reshuffle to the South African team. He was replaced by fast-medium bowler Kyle Abbott, 25, who earned his first cap after being called into the squad as cover earlier in the week.
Abbott topped the wicket-takers in the domestic first-class competition, taking 49 wickets for the Dolphins at an average of 15.36.
It was the first time this season that South Africa had gone into a Test match without seven specialist batsmen.
South Africa, who had already clinched the series by winning the first two Tests, had one other injury-enforced change, with Rory Kleinveldt replacing fellow fast bowler Morne Morkel.
Pakistan made three changes, with Imran Farhat replacing opening batsman Nasir Jamshed, while Rahat and Adil came in for Umar Gul and Tanvir Ahmed.
COMMENTS (1)
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ
The game will finish by tomorrow. The Pak batsman lack technique and courage to face bowling in sporting pitches where there is bounce and swing. Very sad.