Pakistan 24 for 3 (Anderson 3-13) trail England 583 for 8 declared (Crawley 267, Buttler 152) by 559 runs

James Anderson took three late wickets to ram home England's advantage on the second day of the third and final Test against Pakistan after Zak Crawley's 267 led them to an imposing first-innings total.

With 11 overs left in the day after Joe Root's declaration, Anderson bowled a superb new-ball spell to remove both of Pakistan's openers and their best batsman, leaving them reeling at 24 for 3 and some 559 runs behind ahead of the second day.

England had piled on 583 for 8 declared, their highest total in four years, despite the absence of their best batsman Ben Stokes for family reasons. Crawley turned his overnight score of 171 into a maiden first-class double hundred in a commanding 359-run partnership with Jos Buttler, who buckled down to bring up only his second Test hundred.

In a morning session twice interrupted by the weather, Buttler and Crawley struggled to score with the fluency they had demonstrated on the first evening - Crawley spending 40 balls on 171 before eventually adding to his score.

Buttler survived two scares. The first came on 91 when he was trapped on the pad by Shaheen Afridi. Michael Gough shook his head, and Hawk-Eye showed that the ball was going over the top of the stumps after Pakistan reviewed.

The second was a heart-in-mouth moment, as he was given out caught behind on 99, groping at a ball in the off-stump channel from Mohammad Abbas with the wicketkeeper up to the stumps. He reviewed the decision immediately, and it was clear that the only shimmer on Ultra-Edge came when his bat hit his pad. A ball later, he brought up his hundred with a punch through point off Abbas, saluting the dressing room with a beaming smile and exhaling in relief.

Crawley ticked off various landmarks of his own in the afternoon session, moving to 200 with an edge through the slips, nudging a single off Yasir Shah to go past his mentor Rob Key's highest score of 221, and whipping Abbas through square leg to bring up 250.

Buttler, meanwhile, struggled to find the tempo that he had settled into on the first day. He went 106 balls without a boundary, spanning the whole of the afternoon session, though he did continue to tick over with regular singles and twos. Pakistan's heads dropped as fatigue set in, and Azhar Ali found himself turning to part-timers in the hope of a breakthrough.

It was Asad Shafiq who eventually removed Crawley, though not before he had 267 to his name. He speared one in down the leg side which Crawley charged, turning round to find Mohammad Rizwan had completed a sharp stumping.

That meant the end of the joint sixth-highest partnership in England's history, their highest for the fifth wicket, and their 10th-highest individual innings; unsurprisingly, Pakistan's fielders rushed round to congratulate him, with the England balcony offering a standing ovation.

"It's always nice to score all round the ground," Crawley said. "Luckily the pitch was very nice to bat on so it was nice to score a few runs.

"Jos was exactly the right man at the other end, telling me to calm down. He batted brilliantly as well. He played better than me today, he was flawless."

Buttler brought up his 150 soon after tea, crashing Naseem Shah through the covers for four, but chipped a straightforward return catch to Fawad Alam four balls later, looking furious at his dismissal despite it following his highest Test and first-class innings.

England batted on past the drinks break, with Fawad making Chris Woakes his second Test victim as he picked out cover after an enterprising 40, while Dom Bess and Stuart Broad both struck lusty blows. Joe Root eventually called time on the England innings with the score on 583 after Afridi cleaned up Broad, leaving 11 overs for his seamers to wreak havoc with the light fading.

After Masood survived an early scare, successfully reviewing after Broad had trapped him on the pad, Anderson continued his stranglehold over him, pinning him lbw in the third over. He added Abid, nicking off as he prodded forwards, before taking the key scalp of Azam in the day's final over, trapping him on the knee roll in line with the off stump to leave Pakistan staring down the barrel.

Anderson's three scalps leave him only four wickets away from the 600 mark in Tests, and with every chance of reaching that milestone before the home summer is out; it is hard to believe that he was denying rumours he was on the cusp of retirement barely two weeks ago.

Jofra Archer chipped in with a lightning-quick spell of his own, regularly touching the 90mph/145kph mark as Azam and Azhar ducked, weaved and hopped on the crease. With four frontline seamers in their attack, England will offer no respite on the third day, not least with some rain in the forecast for the final two days. Pakistan, meanwhile, know that they desperately need to put at least one substantial partnership on the board if they are to escape with a draw.

Matt Roller is an assistant editor at ESPNcricinfo. He tweets at @mroller98