Half-centuries from Tharanga Paranavitana, Thilan Samaraweera and Thisara Perera allowed Sri Lanka to claim a first-innings lead of 111 on day three of the final Test against Pakistan in Pallekele.
After a complete washout on day two, Sri Lanka resumed on the third morning at 44-3 in reply to Pakistan's 226 and Paranavitana and Samareweera extended their fourth-wicket stand to 143 despite overcast conditions.
Samaraweera survived a chance on 49 when his edged drive off Umar Gul's bowling was put down by Younus Khan at second slip.
Pakistan spinner Saeed Ajmal removed both in the afternoon, Samaraweera lbw on 73 and Paranavitana bowled for 75, as Sri Lanka slipped from 187-3 to 204-6, still 22 behind.
But all-rounder Perera, who had taken four wickets on the opening day, hammered three sixes in his 86-ball 75 to take Sri Lanka's lead into three figures.
He received good support from Nuwan Kulasekara (33) during an eighth-wicket partnership of 84 after tea.
Paceman Junaid Khan (5-70) and Ajmal (3-66) eventually worked their way through the tail to leave Pakistan with a short period to negotiate before the close.
But they were unable to do so, Kulasekara trapping opener Taufeeq Umar lbw in the third over to leave Pakistan on 27-1 in their second innings, 84 runs behind, at stumps.
Adnan Akmal did not keep wicket for Pakistan after suffering a hairline fracture on his left hand on the opening day.
His brother, Umar, took the gloves and conceded 16 byes during Sri Lanka's first innings.
Sri Lanka lead the three-match series 1-0.