England were all out for 327 after losing their final two wickets in the first over after lunch on Friday, giving the tourists a first innings lead of 70 against Pakistan in the second test in Abu Dhabi.
Mohammad Hafeez bowled Anderson (13) with the fourth ball of the afternoon session, clipping off-stump as Anderson tried to cut it away.
The Pakistan all-rounder then trapped Monty Panesar lbw (0) two balls later with a slider that trapped the batsmen in front of the wicket.
Panesar indicated he had got an edge first, but England had already used up their reviews and so he had to walk, leaving Stuart Broad stranded on 58.
Hafeez ended on figures of 3-54. Saeed Ajmal, who claimed the wicket of Matt Prior in the morning session, finished with 4-108.
England will bat last on a deteriorating pitch in Abu Dhabi, so needed to build a healthy first innings lead in their bid to square the three-match series.
The tourists had resumed play on Friday on 207-5, 50 runs behind Pakistan, and they started aggressively, with Ian Bell and Matt Prior both enjoying early escapes after they were dropped in the field.
Bell (29) eventually fell to paceman Umar Gul as Pakistan captain Misbah-ul-Haq took the new ball and rotated his attack, Swann (15) snared lbw by left-arm spinner Abdur Rehman.
But Broad was rampant, recording his 10th test half-century off just 52 balls as England built up a narrow lead.
Pakistan, playing the 'home' series in the Gulf due to security concerns, won the first test by 10 wickets in Dubai last week.