Convicted spot-fixer Mohammad Amir marked his return to first-class cricket in England after a five-year ban with three Somerset wickets.
The Pakistan bowler, playing his first game in England since 2010, took the wickets of Marcus Trescothick, Adam Hose and Peter Trego.
Somerset slumped to 128 all out in reply to Pakistan’s 359-8 declared.
Pakistan made a slower start to their second innings with Jack Leach taking two for 41 as they closed on 140-4.
The tourists declared in the morning session after Younus Khan had collected his 53rd first-class century before being caught by Tim Rouse off the bowling of Josh Davey for 104.
Amir, 24, served a prison sentence as well as his five-year ban from cricket for bowling deliberate no-balls at Lord’s on Pakistan’s last tour.
He was cleared to play domestic cricket in Pakistan in January last year and made his international return in a Twenty20 win over New Zealand in January 2016.
The left-arm paceman was given the new ball on Monday and took the wicket of former England opener Trescothick for eight.
The tourists took regular wickets at Taunton with Amir (3-36) and Sohail Khan (3-26) doing most damage as only James Hildreth (47 not out) even came close to a half-century.
Amir could make his Test return at Lord’s in the first of Pakistan’s four-match series against England on 14 July. (BBC)