De Villiers was last man out for 148 as South Africa were bowled out for 421, a lead of 92.
South Africa then dismissed both West Indian openers before Leon Johnson and Marlon Samuels took the tourists to 88 for two at the close, four runs behind.
De Villiers started the day with an array of attacking strokes, but he was forced to change gears when captain Hashim Amla was caught behind and Temba Bavuma followed soon after the second new ball was taken.
His 21st Test century - and his sixth against the West Indies - was made off 144 balls with 11 fours.
Also Read
As he ran out of partners, with two men run out, he hit a six off Samuels before being caught at wide long-on attempting to clear the boundary again. His innings lasted for 194 balls and he hit 15 fours and a six.
Amla was dismissed by the first delivery sent down after a ball change in the 76th over, with Jason Holder getting extra bounce with the replacement ball to have Amla caught behind.
It was a day of toil for the West Indian bowlers in front of a capacity crowd but they bowled with discipline and kept the scoring under control for the most part with defensive field placing.
Holder and Samuels took two wickets each, while there were three run-outs, two of them direct hits by Jermaine Blackwood and Leon Johnson.