Kumar Sangakkara's eighth Test double century helped Sri Lanka escape with a draw in the first Test against Pakistan in Abu Dhabi.
The former captain hit 211 while Prasanna Jayawardene made 120 as Sri Lanka managed to reach 483 before being bowled out in the final session.
The duo shared in a crucial sixth-wicket stand of 201 that put paid to Pakistan's hopes of victory in the series opener.
Left chasing an impossible target of 170 with little time left in the match, Pakistan reached 21-1 before the teams shook hands on a draw.
Sri Lanka had resumed in the morning on 298-5 in their second innings, still needing a further 16 runs to make their opponents bat again.
They achieved those comfortably enough as Sangakkara, who already had 161 to his name, and Jayawardene dug in during an alliance that finally came to an end in the last over before the tea break.
Pakistan had put down a plethora of chances on the fourth day and once again made mistakes in the field, including throwing to the wrong end when a run out seemed a certainty.
Another mix-up let Sangakkara off the hook again after lunch, and his partner was correctly given not out from a loud lbw appeal off Umar Gul.
Sangakkara passed 200 with a leg glance and soon after that Jayawardene chipped Saeed Ajmal down the ground for four to bring up his fourth Test ton. He then edged the same bowler to the boundary to take the partnership past 200.
However, it came to an end off the very next ball, with the part-time leg-spin of Azhar Ali trapping Sangakkara lbw after the batsman had spent more than seven hours at the crease.
Jayawardene was the next man to fall, caught behind by wicketkeeper Adnan Akmal off the bowling of Aizaz Cheema, and Gul helped clean up the tail to finish with impressive figures of 4-64 from 25 overs.
Pakistan lost Taufeeq Umar - a double centurion in the first innings - lbw to Chanaka Welegedara before the draw was declared. The sides now move on to Dubai for the second Test, which starts on Wednesday.