AB de Villiers' sixth Test century put South Africa on the verge of winning the second Test at Headingley after England ended the third day 269 runs behind the visitors on Sunday. England was 50 for two at the close after Makhaya Ntini dismissed Andrew Strauss, caught behind without scoring from a short delivery after going round the wicket, and Michael Vaughan for 21. Alastair Cook was unbeaten on 23 and was joined by night-watchman James Anderson. South Africa is aiming to take a 1-0 lead in the four-match series after drawing the first Test at Lord's. De Villiers, on 70 overnight, plundered 174 in predominantly sunny conditions for what was the slowest of his Test centuries, helping South Africa to an imposing first innings total of 522 all out in reply to England's 203. South Africa kept England in the field for more than 12 hours. De Villiers, booed to the crease on Saturday after claiming a catch that was grounded earlier in the Test, played an unusually patient innings spanning 381 deliveries. He took his overnight partnership with Ashwell Prince to 212. Prince was caught behind off debutant Darren Pattinson before lunch, one short of his 150 but was still his highest Test score. After Prince's dismissal, de Villiers took up the challenge to eliminate England's chances of an unlikely victory. The century would have been especially satisfying for de Villiers after South Africa coach Mickey Arthur said the batsman had been abused by the England players for his role in the claimed catch on Friday. For the most part de Villiers, so often an aggressor, had played a supporting role to Prince and then Boucher (34). He spent an agonising 45 minutes in the 90s and was stuck on 99 for 14 balls. De Villiers registered the team's 500 with an intelligent cut shot off Stuart Broad to the third man boundary, shortly before number nine batsman Paul Harris hit a six over long-on off Monty Panesar to rub further salt into England's wounds. Another downside of England's struggle in the field would be the amount of overs that Andrew Flintoff (40) and Anderson (44) had to bowl. Match drawn Opener Gautam Gambhir scored an unbeaten half-century as India drew its rain-hit three-day tour match against a Sri Lanka Board XI on Sunday. The left-handed batsman hit six fours in his 60-run knock as the visitors ended day three on 129-2 after the host had declared their second innings on 247-6 in 55 overs. Brief Scores: Sri Lanka Board XI: 224 and 247-6 dec. in 55 overs (C. Silva 59 not out, J. Mubarak 41; Harbhajan Singh 2-53). Indians: 196-8 dec. and 129-2 in 31 overs (G. Gambhir 60 not out, S. Ganguly 26 not out).