Replying to Sri Lanka's 184 all out, England lost captain Andrew Strauss (3) and Jonathan Trott (4) cheaply but a third-wicket partnership of 106 between Pietersen and Cook (55) helped the hosts finish in a dominant position with two days left.

The Sri Lankans, who added just seven runs to their overnight total of 177-9, now have little chance of a victory that would level the three-match series at 1-1.

Pietersen, who returned to form with a much-needed 72 in the drawn second Test at Lord's, followed it up with a scintillating 115-ball knock in Southampton that featured 14 boundaries.

Solid in defense, the talented South Africa-born batsman unleashed an array of attacking strokes in a long final session to thrill a crowd that had previously been left frustrated by a flurry of rain delays.

His brilliant knock was ended 10 minutes before stumps when he edged Thisara Perera to wicketkeeper Prasanna Jayawardene, denying Pietersen an 18th Test century and a first on English soil since 2008.

In-form opener Cook, meanwhile, became the only the fourth English cricketer - and the first in nearly 50 years - to score at least 50 in six straight Test innings.

He hit seven fours before he sent a delivery by Dilhara Fernando to Thilan Samaraweera, who snaffled the catch at gully at the second attempt.

Ian Bell, whose composed 48-ball 39 featured six boundaries, and nightwatchman James Anderson (0) were the not-out batsmen at the close.

The innings of Cook and Pietersen were even more impressive given the situation they found themselves in when they were brought together, with England in deep trouble on 14-2.

Strauss' troubles against left-arm pacemen continued in the 14th ball of the innings when the England captain prodded at a wide delivery by Welegedara, nicking it to Tharanga Paranavitana at first slip.

Welegedara is proving to be Strauss' nemesis in this series - it is the third straight innings that the 30-year-old seamer has snared the Middlesex opener, who has faced Welegedara for just 22 deliveries in three Tests.

Trott, a double-centurion in the first-Test victory at Cardiff, then edged Suranga Lakmal - bowling around the wicket - to wicketkeeper Prasanna Jayawardene five overs later.

Earlier, Dilhara Fernando was left unbeaten on 39, his highest Test score, when Welegedara (7) fell to Stuart Broad, who claimed his sole success of the innings.

Fast bowler Chris Tremlett finished with Test-best figures of 6-48 for England on the ground where he spent 10 years with Hampshire before a move to Surrey last year.

A total of 155 overs have been lost to the weather in the opening three days but the forecast is better for Sunday, giving England an outside chance of victory. More rain is expected on Monday.