Sri Lanka batted out for a draw on the final day of the second Test against Pakistan after being set a target of 261 in 37 overs.
Kumar Sangakkara hit 24 not out as Sri Lanka, who retain their 1-0 lead in the three-match series, closed on 86-2 at Colombo's Sinhalese Sports Club.
Sangakkara had been denied a double century earlier in the day, seventh out for 192 in Sri Lanka's first-innings total of 391.
The home side resumed on the final morning on 278-5, needing another 74 runs to avoid the follow-on.
Sangakkara, on 144 overnight, saw them past that mark and was approaching a ninth Test double century when he misjudged a delivery from left-arm spinner Abdur Rehman.
The left-hander's attempt to go over the top ended in the hands of Taufeeq Umar at square-leg.
His exit followed quickly on the heels of Angelo Mathews, who was caught behind for 47 off Pakistan left-arm seamer Junaid Khan to end a sixth-wicket stand of 92.
From 370-5, Sri Lanka's last five wickets went down for 21 runs after lunch. Junaid finished with 5-73, his second five-wicket haul in Tests, and Rehman 4-78.
Pakistan, needing a win to keep alive their hopes of a series victory, took an aggressive approach to reaching 100-2 in their second innings in the remaining 18 overs of the afternoon session.
Openers Taufeeq (42no) and Mohammad Hafeez (21) put on 51 in 10.3 overs and Rehman, promoted to number three, weighed in with three sixes in his 36 off 22 balls after off-spinner Suraj Randiv removed Hafeez.
Randiv (2-28) bowled Rehman before Pakistan declared at tea to leave Sri Lanka's batsmen to negotiate the final session.
An opening stand of 48 between Tharanga Paranavitana and Tillakaratne Dilshan blunted the tourists' new-ball attack and, although spinners Saeed Ajmal and Rehman did then pick up a wicket apiece, Sangakkara stood firm to complete the stalemate.
The final Test takes place in Pallekele from July 8-12.