At lunch, on the second day of the second Test, England were 272 for three, a lead of 153, with Cook - who made 105 in the drawn series opener at Lord's - a Test-best 114 not out and Paul Collingwood, who was dropped once, unbeaten on 40.
Together the pair had put on an unbroken 103 for the fourth wicket here on Friday.
Cook, in only his seventh Test, had now scored three centuries after making 104 not out on debut against India at Nagpur in March.
England resumed on 168 for two after spearhead fast bowler Stephen Harmison, with a devastating spell of six for 19, and left-arm spinner Monty Panesar (three for 21) ensured the visitors had collapsed Thursday to 119 all out in their first innings after Pakistan captain Inzamam-ul-Haq chose to bat.
Cook was 65 not out and Kevin Pietersen unbeaten on 38.
But Pietersen, to the second legitimate ball of the morning, fell for his overnight score when he edged an intended drive against Umar Gul to gully where the previously fallible Imran Farhat held a sharp catch.
Farhat though dislocated a finger in taking the chance and had to go to hospital for an X-ray.
Meanwhile Faisal Iqbal was off the field after being hit on the arm while fielding at short leg on Thursday, although officials said he had suffered only bruising, not a fracture.
The South Africa-born Pietersen's exit brought Collingwood, whose 186 in the drawn series opener at Lord's was his Test-best score, to the crease as another packed crowd soaked up the sun for a second day in a row.
Left-hander Cook then played the shot of the morning when he drove seamer Mohammad Sami straight back down the ground for four. And Collingwood joined in by forcing Gul off the backfoot to the cover boundary.
On an increasingly benign pitch and, in ideal batting conditions, Collingwood then used his feet to drive leg-spinner Danish Kaneria for six, a shot that gave England a hundred lead.
At the other end the 21-year-old Cook square-cut Abdul Razzaq behind point for four and then a cover-driven boundary off a wide delivery from the same bowler saw the Essex batsman to 97 after he'd taken 12 runs off the over.
In Kaneria's next over, Collingwood again launched him for a straight six.
Then a two off leg-spinner Shahid Afridi saw Cook to a hundred in 208 balls with 14 fours after more than four-and-a-half hours at the crease.
Collingwood, on 39, then survived a sharp chance off Afridi to Younis Khan at short leg and made it through to lunch unscathed.