Jayawardene reached 54 in the second innings of the second Test in the two-match home series .
The 37-year-old will retire from the the game after the series in which Sri Lanka lead 1-0.
Jayawardene, who ends his Test career as the seventh highest run scorer in the five-day format, reached his 50 when he swept a four to fine leg off the bowling of Saeed Ajmal.
The former Sri Lanka captain received a standing ovation from the crowd all the way back to the pavilion.
His batting career in Test cricket ended with Jayawardene scoring 11,814 runs from 149 Tests at an average of 49.84.
Jayawardene needed to score 90 in his final innings to average 50 in Test cricket and bows out as the only player in the all-time top-10 list of Test run scorers not to do so.