The tourists faced no difficult chasing a 183-run target on the third day as left-handed opener Farhat (65) and Younis (73 not out) batted confidently to ensure victory with a 114-run stand for the second wicket on Wednesday.
Pakistan, who drew the opening Test at Colombo, also completed a hat-trick of Test series victories after beating England 2-0 and India 1-0 at home earlier in the season.
Farhat hit 11 fours in his seventh Test half-century while Younis regained form with his 14th half-century after scoring just 43 in the previous three innings against the hosts.
"It was a great win. The boys were confident after we had conceded a big first-innings lead," said Pakistan captain Inzamam-ul-Haq.
"(Mohammad) Asif bowled very well and brought us back into the game. We have been playing good cricket in recent months and hope to keep the momentum going."
It was a painful farewell Test for veteran Sri Lankan opener Sanath Jayasuriya, who was unable to bat in the second innings due to a thumb injury sustained while taking a catch on Tuesday.
The hosts' hopes of defending a modest target depended on ace off-spinner Muttiah Muralitharan, the only bowler to complete 1,000 wickets in Tests and one-day internationals.
But the spinner failed to taste success on his home ground, just a day after 20 wickets had fallen on the same track.
"We played bad cricket yesterday and that one hour was really disappointing," said Sri Lankan captain Mahela Jayawardene, whose team crashed to 73-8 in the closing session on Tuesday.
"Pakistan deserved to win because they played better cricket in the series."
Sri Lanka needed a couple of early wickets to put pressure on Pakistan, but managed just one in the morning when makeshift opener Kamran Akmal was superbly caught by a diving wicket-keeper Kumar Sangakkara off seamer Lasith Malinga.
Akmal, opening the innings following the withdrawal of Shoaib Malik due to fever, contributed a brisk 26-ball 24.
When Farhat was caught by Jayawardene at first slip off seamer Nuwan Kulasekara in the afternoon session, Pakistan were just 31 away from victory.
Younis kept his end intact and completed the formality with Mohammad Yousuf (14 not out), who finished the match with a brace off Malinga. Younis hit 12 fours in his 98-ball knock.
Sri Lanka earlier lasted just one ball before being dismissed for 73, their second-lowest against Pakistan in 32 Test matches after 71 at the same venue in 1994.
Muralitharan was the last man out, caught by Umar Gul at mid-on off seamer Abdul Razzaq.
Seamer Asif finished the match with 11-71, the second-best figures by a Pakistani bowler against Sri Lanka following 14-116 by Imran Khan at Lahore in 1982. Asif was adjudged player of the match and the series.
Razzaq finished with four wickets.