England then reduced Pakistan to 15 for three at stumps, leaving the tourists a further and unlikely 420 to score with two days remaining.
Stuart Broad claimed the wickets of Salman Butt (8) and Azhar Ali (0) while James Anderson snared Umar Amin. Imran Farhat was batting on six and night-watchman Mohammad Aamer was yet to score.
It was a see-sawing day in which Pakistan started by saving the follow-on when Umar Gul scored an exhilarating 65 not out from just 46 balls.
England then slumped to 98 for six but Prior's third Test hundred calmed the nerves.
Even though England held a first innings lead of 172, Prior's runs were important and took England to 262 for nine declared and effectively batted Pakistan out of the match.
SCOREBOARD
ENGLAND (I Innings): 354
PAKISTAN (I Innings, O/n: 147/9)
Gul (not out) 65
Asif (run out) 0
Extras: (B-5, LB-2) 7
Total (all out, 54 overs) 182
Fall of wickets: 9-147.
Bowling: Anderson 22-7-54-5, Broad 17-4-59-1, Finn 13-5-50-3, Swann 2-1-12-0.
ENGLAND (II Innings)
Strauss c K Akmal b Aamer 0
Cook c K Akmal b Asif 12
Trott b Gul 26
Pietersen c K Akmal b Gul 22
Collingwood lbw Gul 1
Morgan (run out) 17
Prior (not out) 102
Swann lbw Kaneria 28
Broad c Farhat b Malik 24
Anderson c K Akmal b Malik 2
Finn (not out) 9
Extras (B-4, LB-11, W-1, NB-3) 19
Total (for 9 wkts decl, 75.3 overs) 262
Fall of wickets: 1-2, 2-18, 3-65, 4-66, 5-72, 6-98, 7-147, 8-203, 9-213.
Bowling: Aamer 16-3-35-1, Asif 17-1-56-1, Gul 15-2-41-3, Amin 5-1-13-0, Kaneria 12-0-71-1, Malik 10.3-0-31-2.
PAKISTAN (II Innings):
Farhat (batting) 6
Butt c Collingwood b Broad 8
Ali lbw Broad 0
Amin lbw Anderson 1
Aamer (batting) 0
Total (for 3 wkts, 7 overs) 15
Fall of wickets: 1-10, 2-10, 3-11.
Bowling: Anderson 4-3-1-1, Broad 3-0-14-2.