South Africa's AB de Villiers plays a shot past Kane Williamson (right) of New Zealand on day two of the second Test in Hamilton.

Hamilton - AB de Villiers guided his side to a 68-run first innings lead after Mark Gillespie had ripped the heart out of South Africa's batting line-up with a five-wicket haul on the second day of the second Test at Seddon Park in Hamilton on Friday.

De Villiers top-scored with 83 and shared valuable tail-end partnerships with Mark Boucher (24), Vernon Philander (14) and Morne Morkel that contributed 131 runs after Gillespie's spell in the first session had reduced them to 88 for six.

The visitors were bowled out for 253, which triggered the tea break after play had been extended with the final pair at the crease, when Imran Tahir was caught by Gillespie off the bowling of Kane Williamson for 16. Morkel was 35 not out.

New Zealand had been bowled out for 185 late on the first day after they had lost five wickets for no runs, slumping from 133-2 to 133-7 in the space of about 15 minutes.

Gillespie, who returned to the side after last playing a test in December 2008, had sparked a remarkable collapse by the visitors in the first session on Friday.

The 32-year-old had figures of 4-24 from seven overs before lunch and completed his second five-wicket haul in his fourth test when he bowled Boucher, surpassing his previous best figures of 5-136, also against South Africa. He finished with 5-59.

Doug Bracewell then bowled Philander after he shoulder-armed to a straight delivery, before De Villiers tried to guide a Daniel Vettori delivery down to third man and only succeeded in chopping the ball onto his stumps.

South Africa had resumed the day's play on 27-2 with Hashim Amla on two and Alviro Petersen on eight after Chris Martin had struck back with two quick wickets late on Thursday.

Amla and Petersen saw off the first 30 minutes of play and were just starting to look comfortable when Amla was well caught by Kane Williamson in the gully for 16 to give Gillespie his first wicket.

Jacques Kallis opened his account with a six from a short Gillespie delivery before he deflected a shot down the leg side only to be snatched by a diving Kruger van Wyk.

Gillespie then trapped Alviro Petersen lbw for 29, then had Jacques Rudolph (one) caught by van Wyk after the delivery caught the thinnest of edges of the left-hander's bat. - Reuters