Dinesh Chandimal smashed his second half-century of the match to put Sri Lanka in the box seat in the opening Test against Pakistan in Galle on Monday.
The hosts were on 329/9 when bad light stopped play with Sri Lanka finishing day three 333 ahead.
Chandimal, who made 76 in the first innings, was batting on 86 with Prabath Jayasuriya on four at the other end.
For them, Oshada Fernando (64) and Kusal Mendis (76) also made significant contribution during their 91-run stand for the third wicket at the Galle International Stadium.
After Sri Lanka resumed on 36/1, Kasun Rajitha could have been dismissed in the first delivery of the day but Babar Azam spilled a catch in the slip.
It did not really matter though as Mohammad Nawaz (5-88) dismissed Rajitha, who had walked in as the nightwatchman on Sunday, in the next over.
Fernando and Mendis scored briskly to consolidate Sri Lanka's position.
Pakistan claimed five wickets in the second session but they struggled to stem the flow of boundaries.
Leg-spinner Yasir Shah (3/122) dismissed Mendis with gem of a delivery that landed way outside the leg stump and spun sharply to beat the bat and hit the top of the off-stump.
Chandimal, who smashed 206 not out in his previous test against Australia at the same venue, continued to pile on the runs hitting five fours and two sixes in his resolute innings.
With Sri Lanka in a state of emergency, the second and final test against Pakistan, originally scheduled in capital Colombo, will also be played in Galle.