Opener Kaushal Silva was run out after scoring 80 off 218 deliveries while attempting to take a single with his captain Angelo Mathews. Silva's knock took more than five-and-a-half hours and included 10 fours.
The dismissal ended a 72-run stand for the fourth wicket with Mathews, who remained unbeaten on 57.
Shah then bowled Dinesh Chandimal (1) and Kithruwan Vithanage (3), and has figures of 3-70.
Dhammika Prasad was on 13.
Pakistan was bowled out for 138 in its first innings on the opening day Thursday.
Sri Lanka wins toss and bats first in 2nd test vs. Australia