Shan Masood (21) and Abid Ali (32) stood firm in the twilight phase of Day 2 for Pakistan as they posted 57-0 at stumps.
Pakistan will be 23 runs behind when they resume the play on Day three of the second Test at National Stadium Karachi.
Earlier, Shaheen Shah Afridi bagged five-wicket haul to help Pakistan hold Sri Lanka to 271 all-out in the first inning. Besides Afridi, Mohammad Abbas bowled brilliantly and supported his partner strongly. The right-arm pacer bagged four wickets for 55 runs.
Haris Sohail provided much-needed breakthrough by picking up well-set Dinesh Chandimal, playing exceptionally at 74 meanwhile helping his team to take lead over hosts.
Dilruwan Perera fought hard in the end with tail-enders and scored 48 runs off 81 balls with the help of six boundaries and a six. Dhananjaya De Silva made 32.
Silva along with Chandimal put up a supporting 67 runs partnership after visitors lost a couple of early wickets at day’s start. De Silva missed out on Afridi, his third wicket in the match.