Sri Lanka batting coach Marvan Atapattu praised the batsman's gesture.
"You don't see that very often, especially in the 90s, it was a nice gesture," he said. "The fielder was pretty sure it was a clean catch. I, myself, looking from the outside, was not that sure. Personally, I wouldn't have done what AB did, to be very honest."
De Villiers showed great determination and concentration in his 135-ball innings that was studded with fine strokeplay and contained 12 fours.
Ashwell Prince and Mark Boucher, both under pressure to keep their places in the team, were also able to rise to the occasion as South Africa's lower order more than doubled the score after they had been struggling on 173 for five.
Prince scored 39 before he edged medium-pacer Angelo Mathews to wicketkeeper Kaushal Silva, but the left-hander could consider himself fortunate to have survived two dropped catches. He was was dropped by Perera, diving forward in the gully, off Dilhara Fernando on 23, and by Silva off left-arm spinner Rangana Herath when he had 26.
Boucher finished the day on 49 not out, helping himself to six fours in a confident innings that has eased the pressure on the veteran wicketkeeper/batsman.
Last man Imran Tahir batted with cavalier disdain for the bowlers and stayed with Boucher for the last 38 minutes before stumps, making his highest test score of 24 not out as they put on 39 for the 10th wicket, extending the lead past 200.
Sri Lanka's attack had bowled with perseverance but little penetration as they failed to obtain the same assistance from the pitch as the South African bowlers. Perera was the most successful bowler with three for 114 from 24 overs.
De Villiers and Prince combined in a sixth-wicket stand of 97 to take South Africa into a handy lead.
The pair rescued the innings against a probing Sri Lankan attack which had reduced South Africa to 173 for five shortly after lunch.
Left-arm paceman Chanaka Welegedara removed Jacques Kallis for 31 in the fourth over after lunch, his first from the Hennops River End. South Africa's leading run-scorer drove at a delivery that pitched on off stump and was moving further away from him to edge a tumbling catch to Mathews at third slip.
De Villiers took no risks, pushing singles through the off side but punishing any poor deliveries on the leg side.
Prince was off to a quick, if streaky, start, collecting four fours, all of them to the third man boundary, off 98 balls.Scorecard
A top-class spell of seam bowling by Perera had earlier allowed Sri Lanka to restore a semblance of parity as South Africa reached 168 for four at lunch.
South Africa resumed on 90 for one and made a poor start to the day when nightwatchman Dale Steyn was run out for a duck in the second over of the morning.
Steyn fended a lifting delivery from Welegedara to the leg-side and there was confusion between him and Jacques Rudolph, allowing Rangana Herath at mid-wicket to score a direct hit on the stumps.
Rudolph and Hashim Amla (18) added 35 for the third wicket, but the Sri Lankan bowlers kept plugging away and Perera reaped the reward.
Bowling a consistent line and length outside off stump, Perera found the edge of Amla's bat and Mathews took a fine diving catch at third slip.
Opening batsman Rudolph, battling the pain of a dislocated little finger on his left hand, showed tremendous determination in a 228-minute vigil at the crease, but Perera ended his resistance on 44, nipping away a delivery that found the edge and travelled low to Tharanga Paranavitana at first slip.
Kallis's 56-ball stay was not without incident.
He ducked into a bouncer from fast bowler Fernando and was struck a disorientating blow on the earpiece of his helmet. Kallis received treatment for seven minutes before resuming his innings on 25 and was lucky as he prodded at the first delivery of Fernando's next over and edged a catch which diving wicketkeeper Silva should have taken.