Pakistan resisted the temptation of declaring overnight on 488, and came out with an apparent target of 550 in mind.
It took Pakistan little under an hour, and 12.4 overs, to score the 63 runs that took them past 550 during the morning sessions.
In the process Misbah reached his 17th half-century, scoring 37 off 40 balls on the third morning.
The fields were spread far out so he had to rely more on well-placed ones and twos as opposed to boundaries.
Asad Shafiq and Adnan Akmal perished for the cause, but Rehman provided the required thrust with sixes off both spinners.
Sri Lanka opened with Tharanga Paranawithana and Tillekeratne Dilshan but lost Tharanga for a duck.