Fourth Test, The Oval, day two (close):
South Africa 194 & 37-1 v England 316
Pietersen's century formed the basis for England's healthy lead
Kevin Pietersen marked his first Test as captain with a century that helped England retain the upper hand after two days of the fourth Test at The Oval.
Pietersen guided the hosts past South Africa's first-innings 192 but fell for 100 as Makhaya Ntini (5-94) and Jacques Kallis (3-51) prompted a collapse.
England were dismissed for 316 with Steve Harmison finishing 49 not out.
James Anderson removed Graeme Smith before the close, which the tourists reached on 37-1, a deficit of 85 runs.
Anderson's late strike, trapping the South Africa captain lbw with a beautiful delivery that swung back into the left-hander's pads, kept Pietersen's men on top going in to day three.
But South Africa showed earlier how quickly the tide can turn - hauling themselves back into contention before Harmison's vital contribution - and the rate at which Hashim Amla scored before stumps is sure to give them hope.
Resuming on 49-1 after bowling South Africa out for 194 on day one, England would have been eyeing a hefty lead.
But in the end almost all the damage was done by Pietersen and Paul Collingwood's 108-run partnership for the fourth wicket.
England collapsed badly from 219-3 to 263-8 and needed Harmison and James Anderson's 53-run stand at the end to make the lead significant.
When play got under way after a 30-minute rain delay, the hosts' progress was almost immediately checked by Ntini.
Ian Bell, who along with Alastair Cook had rarely been troubled the previous evening, negotiated only three balls before coming forward to defend a full delivery and edging to Smith at first slip.
The South African seamers were beginning to exploit the overcast conditions, generating similar movement to that enjoyed by England in the tourists' first innings.
But Cook and Pietersen batted with fine discipline, playing cautiously outside off stump but gleefully dispatching anything bowled short of a length or into their legs.
Pietersen illustrated his improved ability at dealing with the shorter ball - rocking back and pulling Morne Morkel for successive boundaries in the 27th over.
South Africa continued to plug away though, and were rewarded when Cook lost his concentration 14 balls before the interval.
The Essex opener flashed wildly at a delivery wide outside off stump from Ntini, clipping into wicketkeeper Mark Boucher's palms.
Things could have worsened for England moments later as McKenzie narrowly missed with a shy at the non-striker's end which would have signalled the end for Collingwood.
Collingwood, who went on to make 61, looked far more comfortable after lunch and worked Kallis for three leg-side fours and another punched through the covers.
Pietersen brought up his half-century in style - stepping outside off stump, swivelling on one leg and pulling Ntini for a sensational four - but the skipper was then fortunate to survive.
The 28-year-old top-edged Morkel and should have been snapped up by either Ntini at long leg or Paul Harris at deep square-leg, but the pair failed to communicate and Ntini's dive was in vain.
Ntini was well worth his 18th five-wicket haul in Test cricket
Morkel twice beat Collingwood's outside edge and, in between, Pietersen was dropped by a back-tracking Ntini at mid-on after again top-edging an attempted hook, this time off Nel.
Pietersen appeared to grow in confidence after his second reprieve and, after playing some stunning strokes on both sides of the wicket to give England the lead, flicked Ntini past midwicket to seal his ton.
He became the fourth player to score a century on his debut as England's Test captain.
Sections of the crowd were still celebrating Pietersen's feat when he became Ntini's fourth victim, kissing a wide ball outside off to Kallis in the slips.
The feel-good factor was passed onto Andrew Flintoff, who came in at six and duly lofted Harris over long-on for a maximum that sent England in for tea on 232-4, a lead of 38.
Upon the resumption Collingwood passed 50, but two balls later England were deflated as Flintoff drove recklessly at Kallis and presented Boucher with an easy take.
Kallis had taken over from Ntini as England's tormentor-in-chief, coaxing an edge out of Tim Ambrose and having Collingwood caught and bowled.
The hosts' run rate had slipped to a little more than two an over by the point Stuart Broad was out for his first single-figure score since March, giving Ntini his 18th five-wicket haul in Test cricket.
But South Africa were caught unawares by Harmison, whose previous highest Test score was 42, and he passed that by crashing Nel past backward point for four.
The Durham paceman has enjoyed a fairytale two days since returning to the Test scene and, although he was dropped by Boucher on 19, he combined canny stroke-making with dogged defence.
With Amla and Neil McKenzie scoring at almost five an over, Harmison's runs may well prove crucial to England's chances.