Abu Dhabi - Record-breaking batsman AB de Villiers has praised his captain Graeme Smith for helping him break his record for the highest Test score by a South African. De Villiers hit an unbeaten 278 on the second day of the second Test against Pakistan at Abu Dhabi Stadium, beating the 277 his captain made against England at Birmingham in 2003. De Villiers' effort helped South Africa declare their first innings at 584-9 before restricting Pakistan to 59-1, still needing 326 more runs to avoid the follow-on in the two-Test series, after the first match ended in a draw in Dubai. The 26-year-old De Villiers dedicated the innings to Smith. "I would like to dedicate this knock to Graeme," De Villiers said after the match. "He showed a lot of class in his captaincy allowing me to go through and get that record. "I thought we could have declared much earlier, before tea, but he wanted me to get on and that says a lot about him as captain. Lot of credit to him," said De Villiers of Smith who waited on the declaration until De Villiers broke his record. De Villiers added 273 runs for the last five wickets, including a South African record of 107 for the last wicket with Morne Morkel, who finished with 35 not out. "It was amazing how all the tail-enders stuck with me and it in fact inspired me to go and get that record," said De Villiers who added 73 for the sixth wicket with Mark Boucher and 59 for the seventh wicket with Dale Steyn (27). De Villiers said his knock was special as it was made after South Africa were rattled by debutant paceman Tanveer Ahmed's triple strike, leaving the team at 33-3 on Saturday. "Even more special to get my side out of trouble. I love to be a team man and get my team out of trouble. So it is a very special day and a very special innings," said De Villiers, who added 179 for the fourth wicket Jacques Kallis (105) on the first day. "Yesterday the wicket was not very easy and I realised I had to just stick around. With Kallis scoring all the runs there was no need for me to play the same kind of game. "That’s what Test cricket is all about, one player scores and the other hangs around. And my chance came today to push the score up. But right through the innings my role was to see we don’t get bowled out." De Villiers denied a 300-plus score -- never achieved by a South African in all Test cricket -- was on his mind. "Three hundred was never in my mind. Of course 200 was but even the record was not until Smith signalled me on to it and I am happy with what I got," said De Villiers, whose previous best score was 217, against India at Ahmedabad in 2008.