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.
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.
Pakistan first innings
Mohammad Hafeez b Perera 22
Taufeeq Umar lbw b Perera 29
Azhar Ali c Samaraweera b Perera 0
Younus Khan c P Jayawardene b Kulasekara 0
Misbah-ul-Haq c P Jayawardene b Perera 40
Asad Shafiq c P. Jayawardene b Herath 75
Adnan Akmal b Herath 24
Mohammad Sami c Perera b Mathews 9
Umar Gul b Kulasekara 7
Saeed Ajmal lbw b Herath 6
Junaid Khan not out 3
Extras (lb-11) 11
Total (all out, 72.5 overs) 226
Fall of wickets: 1-35 2-41 3-50 4-56 5-141 6-175 7-198 8-217
Bowling: Kulasekara 16-4-44-2, Perera 18-5-63-4, Mathews
8-3-20-1, Herath 18.5-6-40-3, Fernando 12-1-48-0
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
Extras: (b-10 w-1) 11
Total (for three wickets, 14.4 overs) 44
Fall of wickets: 1-14 2-14 3-44.
To bat: T. Samaraweera, A. Mathews, P. Jayawardene, T.
Perera, N. Kulasekara, R. Herath, D. Fernando.
Bowling: Gul 6-1-16-0, Junaid 6-0-15-2, Sami 1.4-0-2-1 (1w),