England, 1-0 up in a three-match contest and looking for a first series win over Pakistan in a decade, then saw Anderson reduce the tourists to 24-3 at the close .
Zak Crawley said he "couldn't have dreamed for a better score" after converting his maiden Test hundred into a superb innings of 267 against Pakistan at Southampton on Saturday before England great James Anderson rocked the tourists with a late treble strike.
Crawley and Jos Buttler, who made 152, shared a stand of 359 that powered England to 583-8 declared on the second day of the third Test.
England, 1-0 up in a three-match contest and looking for a first series win over Pakistan in a decade, then saw Anderson reduce the tourists to 24-3 at the close – a deficit of 559 runs – as he moved to within four of becoming the first paceman to take 600 wickets in Tests.
"I couldn't have dreamed for a better score I'm absolutely delighted and we're in a very good position with Jimmy at the end there," Crawley told Sky Sports.
Pakistan's Shan Masood was plumb lbw for four to Anderson before fellow opener Abid Ali (one) edged low to Dom Sibley at third slip.
And with what became the last ball of the day, Anderson had star batsman Babar Azam lbw for 11 with one that cut back to finish with stumps figures of 3-13 in 5.5 overs.
Pakistan batsman Fawad Alam, however, insisted that "we don't think the match has finished".
"We will fight it out and if we get two big innings everything will change. It's cricket and we are a fighting unit that can do that."
England's total was their highest in Tests since they made 589-8 declared against Pakistan at Old Trafford four years ago.
Three of Pakistan's frontline bowlers conceded over 100 runs each, with leg-spinner Yasir Shah (2-173 from 39 overs) and teenage paceman Naseem Shah (1-109 in 27) both going for more than four an over.
Crawley's innings was the seventh highest maiden hundred in 143 years of Test-match cricket and the 10th highest score by any England batsman.
"It's very humbling indeed, I don't see myself anywhere near their calibre but hopefully I can build on this," said Crawley.
His partnership with Buttler was also a new England fifth-wicket record in Tests, surpassing the 254 shared by Keith Fletcher and Tony Greig against India at the Brabourne Stadium in Mumbai in February 1973.
"Jos was exactly the right man at the other end, telling me to calm down," said Crawley. "He played better than me today, he was flawless."
One of the few false shots of his innings saw Crawley go to 200 when he edged a four past second slip off Naseem.
But he still received applause from his team-mates in a match being played behind closed doors because of the COVID-19 outbreak.
The 22-year-old Crawley was the seventh England batsman to turn his maiden Test hundred into a double century and the first since Rob Key against the West Indies at Lord's in 2004.
Earlier, Buttler completed just the second hundred of his 47-match Test career and first as a wicketkeeper.
Crawley lofted Yasir over long-off for six before a clipped boundary off Mohammad Abbas saw him to 250.
But his near 10-hour innings end when he was stumped down the legside by Mohammad Rizwan off part-time spinner Asad Shafiq. Crawley faced 393 balls, hitting 34 fours and one six.
Together with Buttler, he had taken England from 127-4 to 486-5 against an increasingly ragged Pakistan.
World Cup-winner Buttler saw his seven-and-a-half-hour innings – the longest of his career – end tamely when he chipped a gentle return catch to Alam, another occasional spinner.
England resumed Saturday in a commanding position at 332-4.
Crawley was 171 not out, in his eighth Test, with Buttler unbeaten on 87.
Buttler, one ball after successfully reviewing a decision to give him out caught behind on 99, punched seamer Abbas through point to complete a 189-ball hundred with 10 fours and two sixes.
It was just the 29-year-old's second century in 47 Tests following his 106 against India at Nottingham two years ago.
Find latest and upcoming tech gadgets online on Tech2 Gadgets. Get technology news, gadgets reviews & ratings. Popular gadgets including laptop, tablet and mobile specifications, features, prices, comparison.
The Bihar Cricket Association was earlier not allowed to amend its constitution and was directed to file an affidavit explaining the mechanism for its elections.
Mosaddek Hossain's all-round skills helped Bangladesh register a series weep over UAE as they prepare for the T20 World Cup.
England white-ball captain Jos Buttler picked up the injury in England while playing domestic cricket. He has not played any international cricket since July.