South Africa were 290 for three at tea, still 339 runs behind England's first innings total of 629 for six declared.
De Villiers was out for 88 after he and captain Hashim Amla put on 183 in a third wicket partnership that lasted for two minutes short of five hours.
Amla, who survived two chances, was unbeaten on 132, his first Test century since he made 208 against the West Indies in Centurion in December 2014.
Both men batted solidly for the most part but had anxious moments which required decisions by television umpire Rod Tucker.
Amla managed to get his bat down just in time after Finn deflected a drive by De Villiers into the stumps at the bowler's end.
De Villiers was given out leg before wicket to Ben Stokes by umpire Aleem Dar when he had 85 but De Villiers immediately sought a review which showed the ball had gone off an inside edge onto his pad.
He had defied the England bowlers for 298 minutes and 211 balls, hitting 12 fours and a six.
Amla, who had averaged 15.00 in his previous ten Test innings, batted solidly apart from his two chances, reaching his 24thh Test century off 214 balls when he hit the 16th four of his innings.
