Colombo - Kumar Sangakkara was unbeaten on 144 as Sri Lanka reached 278 for five at stumps on the fourth day of the second Test against Pakistan in Colombo on Tuesday.
Tillakaratne Dilshan was dismissed for 121 after he and Sangakkara added 225 runs for the second wicket.
Pakistan then claimed three easy wickets - both Mahela Jayawardene and Thilan Samaraweera departed without scoring, and night-watchman Suresh Randiv was dismissed for five before stumps were pullled.
Sri Lanka need another 74 runs to avoid the follow-on.
Earlier, the hosts, replying to Pakistan's first innings total of 551-6 declared, took their overnight score of 70-1 to 178 without further loss by tea on the fourth day at the Sinhalese Sports Club in Colombo.
Dilshan was unbeaten on 85 and Sangakkara was on 90, as the pair put on 167 runs for the second wicket after opener Tharanga Paranavitana fell for zero on Monday.
Sangakkara scored an unbeaten 199 and Dilshan made 101 in the first Test in Galle last week which Sri Lanka won by 209 runs to take the lead in the three-match series.
Rain allowed just 17 overs to be sent down in the post-lunch session after bad weather on the previous two days restricted play to only 71 of the stipulated 180 overs.
More rain has been forecast for the final day on Wednesday.
When Sangakkara reached 60, he became the highest run-getter against Pakistan, surpassing Indian great Sunil Gavaskar's tally of 2 089 runs from 24 Tests.
Sangakkara, who is playing his 15th Test against Pakistan, has already scored eight centuries against them with a top score of 230 in Lahore in March, 2002.
The third Test will be played in Pallekele from July 8.