Kevin Pietersen was back to his explosive - and controversial - best as his stunning century put England in control of the second Test against Sri Lanka.

He came to the crease with a top score of 32 in eight innings this year but by the end of day three at the P.Sara Stadium he had become the sixth man to score 20 Test centuries for England, with his 151 helping England reach stumps 181 ahead.

His innings contained six sixes and 16 fours but also included an official warning from the umpires for altering his stance before the bowler's delivery stride, collected during an eventful passage of play where Tillakaratne Dilshan twice refused to bowl after Pietersen re-set his position at the crease.

Had the former Hampshire player transgressed again, England would have been given a five-run penalty by the match referee, Javagal Srinath.

Alastair Cook had earlier fallen six short of his own 20th hundred and Jonathan Trott contributed a fluent 64 in England's total of 460 all out.

They started the day on 154 for one, Cook on 77 and Trott with 15.

That left Sri Lanka's lead at 121, a figure they whittled down to 100 inside six overs. With Cook quiet, Trott was doing most of the scoring in ones and twos, adding the occasional boundary.

Cook's stately knock had reached 94, in 278 balls, by the time he edged Tillakaratne Dilshan to slip.

His replacement, Pietersen, pulled Suranga Lakmal contemptuously for his first boundary, while Trott was typically ruthless through the on-side as he passed 50.

Pietersen offered one half-chance before lunch, looping over short-leg via bat and pad, but England reached the interval without further loss on 239 for two.

Pietersen resumed on 18 and settled into his afternoon's work with a mighty straight six off Dilshan.

Trott did not seem as comfortable as he had before the break and should have been stumped before steering Herath into Mahela Jayawardene's hands for 64.

Pietersen was not affected by the dismissal, taking fifteen off Suraj Randiv's next over including fours on each side of the wicket and another six down the ground.

A third maximum, again off Randiv, brought up a 59-ball half-century and, more importantly, took England into the lead. Pietersen looked in particularly inspired form, thrashing back-to-back fours off the victimised Randiv and carving Herath to the extra-cover ropes.

Jayawardene duly packed his leg-side field and ordered defensive lines in an attempt to stifle Pietersen, who responded by unveiling a series of pre-meditated paddles, reverse sweeps and even his seldom-seen switch-hit.

The runs kept flowing but Sri Lanka were unhappy with Pietersen's tactics and Dilshan twice aborted his run-up as the batsman got into position too early.

The umpires took Dilshan's side, with Asad Rauf formally warning Pietersen and indicating a five-run penalty should he transgress again.

But it was Dilshan who lost his composure. Pietersen took 18 runs off the over in question, smashing three terrible deliveries for two fours and a six.

Pietersen, never shy of a confrontation, went down early again to reverse-sweep Dilshan for the two runs that brought up his century and celebrated with an exaggerated sprint and air-punch.

Amidst the drama Ian Bell made a low-key 18 before being caught at mid-wicket just before tea.

Matt Prior was Pietersen's new foil, but managed only 11 before skying Rangana Herath to long-off early in the evening session.

Pietersen was in the zone, though, clearing the ropes again off Herath and Lakmal as he almost single-handedly moved England from 350 to 400 in the space of 65 balls.

He took his own tally to 150 soon after but added just one more single before eventually missing one and departing lbw to former Hampshire player Herath.

That left England 411 for six, a lead of 136.

Tim Bresnan followed closely behind, bowled by Herath for five, but England's lead ticked beyond 150 when Graeme Swann got off the mark with a boundary.

Samit Patel was playing responsibly at the other end, allowing the tail-ender to attack. Swann obliged with six over long-on but was out next ball, mis-hitting a Herath full toss to cover.

James Anderson (two) gave the tireless Herath a sixth success before Patel holed out for 29.

Anderson then had one unsuccessful over at nightwatchman Dhammika Prasad before the close.