de Wet got the first wicket of the day by dismissing night watchman James Anderson.
Soon to depart was Cook, dismissed by Harris for 12.
This brought together Pietersen and Trott who resisted the South African attack as they built a steady partnership.
During the stand, Pietersen registered his fifty.
Soon, Trott got to the half-century mark.
The 145 run stand came to an end when Pietersen was run out for 81.
South Africa tasted their next success when Ian Bell was dismissed by de Wet.
de Wet then got the important wicket of Trott, getting him out for 69.
de Wet went on to scalp his fourth, dismissing Prior, putting England in a spot of bother.
Broad fell to Harris as England were reduced to 209/8.
Defeat loomed closer for England as Morkel got the better of Swann.
But Collingwood and Onions hung on till the end, managing to secure a draw for England.