Karunaratne was unbeaten on 89 and captain Dinesh Chandimal was 14 not out after Sri Lanka won the toss and opted to bat on a flat pitch.
Karunaratne and opening partner Kaushal Silva (27) gave Sri Lanka a solid 63-run start before Pakistan hit back with three wickets in quick succession.
Leg-spinner Yasir Shah provided his team with the much- needed breakthrough when he had Silva caught behind off a short delivery.
Kusal Mendis played a rash drive off Shah and was caught in the slips for one.
Also Read
Karunaratne cracked three boundaries in an Amir over and hit Shah for another to reach his sixth Test fifty.
Sri Lanka lead the series 1-0 after winning the first Test by 21 runs in Abu Dhabi.
This is the sixth day-night Test with a pink ball since Australia and New Zealand played the first at Adelaide in December 2015.
Disclaimer: No Business Standard Journalist was involved in creation of this content