Young seamer Thisara Perera grabbed a career-best 4-63 as Sri Lanka bowled out Pakistan for 226 on the opening day of the final Test in Pallekele on Sunday.
Left-arm spinner Rangana Herath chipped in with three wickets after Sri Lankan captain Mahela Jayawardene put the tourists in to bat for the second consecutive match.
Pakistan hit back to reduce Sri Lanka to 44-3 by stumps as left-arm seamer Junaid Khan removed Dinesh Chandimal and dangerman Kumar Sangakkara in the space of four deliveries.
Chandimal was leg-before for eight, while Sangakkara was bowled for zero after making 199 not out and 192 in the previous two Tests.
Mohammad Sami then trapped skipper Jayawardene leg-before in the last over of the day to cap an absorbing day's play at the Pallekele International Stadium.
Pakistan, looking for a series-levelling win, failed to adjust to the moving ball on a responsive wicket and collapsed to 56-4 soon after the first hour of play.
They recovered through a fighting 75 from Asad Shafiq, who put on 85 for the fifth wicket with skipper Misbah-ul-Haq (40) before the innings terminated midway through the post-tea session.
Pakistan first innings:
M Hafeez b Perera 22
T Umar lbw b Perera 29
A Ali c Samaraweera b Perera 0
Y Khan c P. Jayawardene b Kulasekara 0
M-ul Haq c P. Jayawardene b Perera 40
A Shafiq c P. Jayawardene b Herath 75
A Akmal b Herath 24
M Sami c Perera b Mathews 9
U Gul b Kulasekara 7
S Ajmal lbw b Herath 6
J Khan not out 3
Total (all out, 72.5 overs) 226
Fall of wickets: 1-35 (Hafeez), 2-41 (Azhar), 3-50 (Younis), 4-56
(Taufeeq), 5-141 (Misbah), 6-175 (Sami), 7-198 (Akmal), 8-217 (Gul), 9-217 (Shafiq), 10-226 (Ajmal).
Sri Lanka first innings
T Paranavitana not out 13
D Chandimal lbw b Junaid 8
K Sangakkara b Junaid 0
M Jayawardene lbw b Sami 12
Total (for three wickets, 14.4 overs) 44
Fall of wickets: 1-14 (Chandimal), 2-14 (Sangakkara), 3-44 (M. Jayawardene).
Bowling: Gul 6-1-16-0, Junaid 6-0-15-2, Sami 1.4-0-2-1 (w1), Ajmal 1-0-1-0.
Sri Lanka, who won the first Test in Galle before the second in Colombo was drawn, are seeking their first series win in three years, after defeating New Zealand 2-0 at home in 2009.
Perera, a 23-year-old playing only his sixth Test, made an immediate impact in his maiden appearance in the series by grabbing three wickets in his first eight overs.
Unlike the second Test where Jayawardene's decision to field on a flat track backfired as Pakistan ran up 551-6 declared, the hosts finally found conditions that suited the bowlers.
The bounce on the greenish pitch was less than expected - the wicket-keeper stood up to the stumps as early as the third over - but there was considerable movement in the air and off the wicket.
Perera, taking advantage of overcast conditions, struck after Pakistan's openers had rattled up 35 by the eighth over, bowling Mohammad Hafeez with a delivery that swung in sharply.
Hafeez, who scored 196 in the second Test, made 22 with four hits to the fence.
Azhar Ali, another century-maker in Colombo, edged a wild drive off Perera to Thilan Samaraweera at gully before he had scored a run.
Sri Lanka earned two further wickets on either side of the morning drinks break when veteran Younis Khan was caught behind off Kulasekara and Taufeeq Umar was leg-before to Perera for 29.
Misbah defended stoutly for his 40 off 95 deliveries as he rebuilt the innings with Shafiq, but fell just when the pair appeared set for a big partnership. Misbah, who hit seven fours, followed a ball from Perera that was pitched outside the off-stump and gave wicket-keeper Prasanna Jayawardene an easy catch.
Shafiq reached his sixth Test half-century by slashing Dilhara Fernando over the slips for his seventh boundary just before tea, but soon ran out of partners.
Sri Lanka suffered a setback before the start when experienced opener Tillakaratne Dilshan opted out of the Test and returned home to Colombo due to health worries in his family.
Dilshan was replaced by Chandimal, while Suraj Randiv and Nuwan Pradeep made way for Fernando and Perera.
Pakistan included Umar Gul and Sami, who both missed the second Test, in place of Aizaz Cheema and Abdur Rehman.