Sarfaraz Ahmed raised his bat for the century from 109 balls which comprised of seven boundaries and a six. He was back in the pavilion after scoring 103 from 127 balls.
Pakistan were all out for 332 runs at lunch break on day two.
Meanwhile, Herath took nine wickets after bowling 33.1 overs in the innings. Dilruwan Parera took the remaining one wicket of Pakistan innings.
Sri Lankan batsman will start their second innings after the lunch break.