Pakistan were 19 for one in their second innings, still needing 160 more runs to make England bat again, at stumps on the second day of the second Test.
Pietersen's innings was the cornerstone of England's 251 that ensured a first innings lead of 179 after Pakistan had been dismissed for just 72 -- their lowest total against England.
That had followed Pakistan's previous worst of 80 made in a huge 354-run defeat in the first of this four-Test series at Trent Bridge on Sunday.
Pakistan off-spinner Saeed Ajmal took five wickets for 82 runs in 26.1 overs -- his first five-wicket haul in what was only the 32-year-old's sixth Test.
There was still time before bad light forced an early close for Pakistan captain Salman Butt to exit for nought after edging a superb outswinger from James Anderson to opposing skipper Andrew Strauss at first slip.
It meant Butt had scored just 16 runs in four innings this series.
Ali, out for a lengthy duck in the first innings, scored his first run of the match off the 47th ball he faced.
Ajmal, recalled in place of leg-spinner Danish Kaneria, had polished off England's tail with a burst of four for two in 26 balls.
But Pakistan harmed themselves with yet another poor fielding display that saw six catches dropped in the innings.
Pietersen arrived at Edgbaston having gone 22 innings without a Test century since making 102 against the West Indies at Port-of-Spain in March 2009.
The 30-year-old, who has scored 16 hundreds in his now 64 Tests, was far from his fluent best and was dropped three times.
"My confidence has taken a bit of a hit in the last 18 months or so but I'll fight back," Pietersen told Sky Sports. "I suppose I did have fair amount of luck but those are the things."
Pietersen also had a slice of luck when, on 41, he backed away believing the ball was dead and casually spooned a 'catch' following a half-hearted shot off Mohammad Asif to Butt at mid-off.
South African umpire Marais Erasmus signalled dead ball, to the obvious displeasure of Butt, who believed it was 'live'.
"I probably shouldn't have hit it," Pietersen added. "I apologise if I caused any issues. Instinct took over."
Pietersen, dropped twice on Friday, was still on his overnight score of 36 when he was given yet another reprieve.
Trott, 31 not out overnight, followed him to the landmark with a straight driven boundary off Umar Gul, his seventh four in 105 balls.
But the seamer suffered what Pakistan tour manager Yawar Saeed said was a torn hamstring as he ran into bowl and Gul was ruled out of the remainder of this match.
Trott departed when medium-pacer Amin had him caught in the gully by substitute Yasir Hameed.
Pietersen fell short of a century when Ajmal's 'doosra', from round the wicket, led to him being caught and bowled him off a checked drive.
His innings lasted more than three-and-a-half hours, spanned 147 balls and included 12 boundaries.
England, who had been 205 for three, lost their last seven wickets for 46 runs, with Ajmal doing the bulk of the damage.
Butt then dropped a simple chance at mid-off following Graeme Swann's miscued reverse hit off Ajmal.
Ajmal though made sure of his five-wicket return by catching Swann off his own bowling.
Source: AFP South Asian Edition