Opener Dimuth Karunaratne scored a dashing century to guide Sri Lanka to 254-3 at stumps on the first day of the second and final day-night Test against Pakistan in Dubai on Friday.