Misbah-ul-Haq and Shahid Afridi starred as Pakistan earned an 11-run World Cup Group A win over Sri Lanka in Colombo.
Misbah (83 not out) shared a fourth-wicket stand of 108 with Younus Khan (72) as Pakistan totalled 277-7.
Openers Tillakaratne Dilshan and Upul Tharanga gave Sri Lanka a solid start, but when Afridi (4-34) removed Dilshan, they slipped from 76-0 to 96-4.
Chamara Silva (57) and Kumar Sangakkara (49) led the recovery, but the co-hosts could only close on 266-9.
Both strong through the off-side, Dilshan (41) and Tharanga (33) looked to have Sri Lanka well placed to pull off what would have been the fifth-highest successful run chase in World Cup history.
But when Tharanga drove the off-spin of Mohammad Hafeez to Afridi at short extra cover, it began a collapse in which Sri Lanka lost four wickets for 20 runs and perhaps realistic hopes of winning the match.
Some late hitting from Nuwan Kulasekara and an acceleration from the previously subdued Silva took the hosts far closer to their total than had appeared likely but the recovery from the mini-collapse proved to be just beyond them.
The chase had, though, appeared well set before Afridi, who took 5-16 in Pakistan's opening victory against Kenya, struck again to spark the downturn in Sri Lanka's fortunes.
Dilshan played on trying to cut a delivery that was too straight for the shot, Mahela Jayawardene was undone by a ball that nipped back between bat and pad from Shoaib Akhtar and Thilan Samaraweera was stumped by Kamran Akmal after groping for a leg break from Pakistan skipper Afridi and overbalancing.
Sangakkara and Silva tried to rebuild, Silva successfully appealing when given out lbw and Sangakkara surviving a tough leg-side stumping chance - Abdur Rehman the bowler on both occasions - but Sri Lanka fell well behind the required run rate.
In an attempt to claw his side back into the game, Sangakkara opted to take the batting powerplay at the beginning of the 34th over, with more luck going the way of the Sri Lankans.
First, Kamran missed another chance to stump Sangakkara down the leg side, Rehman again the bowler, then the left-arm spinner spilled the simplest of chances at midwicket when Silva miscued a pull off Umar Gul.
Sangakkara top edged Gul over third man for the first six of the innings, but the Sri Lanka skipper's good fortune ended when he found Ahmed Shehzad at long on from the bowling of Afridi, his 300th wicket in one-day internationals.
The departure of his captain sparked Silva, who did not find the boundary until the 67th delivery he faced, into life. Twice in succession he swept Rehman to the fence, before pulling both Gul and Akhtar for fours.
But after Angelo Matthews was caught in the deep off Afridi and Thisara Perera was bowled by Akhtar, Silva ran past a wide from Rehman and Kamran this time made no mistake in completing the stumping.
Kulasekara, who hit 24 from 14 balls, left Sri Lanka needing 18 from the final over, but Gul kept his nerve as Sri Lanka tasted a first ever World Cup defeat on home soil.
Earlier, after winning the toss, Pakistan lost Shehzad (13) caught behind from a flat-footed waft at Perera before Hafeez and Kamran added 48 for the second wicket.
With the boundary easier to find against the hardness of the new ball, Hafeez (32) lifted Kulasekara over square leg for the only six of the innings but he departed in comical fashion at the beginning of the 13th over.
After sweeping Muttiah Muralitharan's first ball of the match to short fine leg, Hafeez failed to respond to Kamran's call, resulting in both batsman meeting at the striker's end.
Wicketkeeper Sangakkara received the ball and then threw wildly over Muralitharan's head, but there was enough time for Sri Lanka to return it to the bowler with both batsmen still 22 yards away. After some discussion, the umpires decided that Hafeez should be the man to depart.
Kamran fell soon after, stumped yards out of his ground after aiming to hit Rangana Herath down the ground, to leave Younus and Misbah the task of consolidating.
The experienced duo responded to the task. With boundaries hard to come by, the Pakistan pair settled for working the ball into the gaps and running well - their 100 partnership came up in 113 balls but featured only four fours.
Younus eventually fell after hitting four boundaries in his 76-ball effort, top-edging a sweep off Herath to short fine leg, to leave Pakistan without his services when they opted to take the batting powerplay.
With Muralitharan back into the attack and having Umar Akmal (10) caught at deep midwicket, Sri Lanka were able to exercise some control, with Pakistan adding 36 runs in the five overs of fielding restrictions, a total boosted by Afridi's 16 from 12 balls.
But batting with a runner Misbah, who had accelerated after reaching a 65-ball half-century, was still there at the end, guiding Pakistan to what a total that, while far from daunting, ultimately proved beyond Sri Lanka.
MATCH SCORECARD
Misbah (83 not out) shared a fourth-wicket stand of 108 with Younus Khan (72) as Pakistan totalled 277-7.
Openers Tillakaratne Dilshan and Upul Tharanga gave Sri Lanka a solid start, but when Afridi (4-34) removed Dilshan, they slipped from 76-0 to 96-4.
Chamara Silva (57) and Kumar Sangakkara (49) led the recovery, but the co-hosts could only close on 266-9.
Both strong through the off-side, Dilshan (41) and Tharanga (33) looked to have Sri Lanka well placed to pull off what would have been the fifth-highest successful run chase in World Cup history.
But when Tharanga drove the off-spin of Mohammad Hafeez to Afridi at short extra cover, it began a collapse in which Sri Lanka lost four wickets for 20 runs and perhaps realistic hopes of winning the match.
Some late hitting from Nuwan Kulasekara and an acceleration from the previously subdued Silva took the hosts far closer to their total than had appeared likely but the recovery from the mini-collapse proved to be just beyond them.
The chase had, though, appeared well set before Afridi, who took 5-16 in Pakistan's opening victory against Kenya, struck again to spark the downturn in Sri Lanka's fortunes.
Dilshan played on trying to cut a delivery that was too straight for the shot, Mahela Jayawardene was undone by a ball that nipped back between bat and pad from Shoaib Akhtar and Thilan Samaraweera was stumped by Kamran Akmal after groping for a leg break from Pakistan skipper Afridi and overbalancing.
Sangakkara and Silva tried to rebuild, Silva successfully appealing when given out lbw and Sangakkara surviving a tough leg-side stumping chance - Abdur Rehman the bowler on both occasions - but Sri Lanka fell well behind the required run rate.
In an attempt to claw his side back into the game, Sangakkara opted to take the batting powerplay at the beginning of the 34th over, with more luck going the way of the Sri Lankans.
First, Kamran missed another chance to stump Sangakkara down the leg side, Rehman again the bowler, then the left-arm spinner spilled the simplest of chances at midwicket when Silva miscued a pull off Umar Gul.
Sangakkara top edged Gul over third man for the first six of the innings, but the Sri Lanka skipper's good fortune ended when he found Ahmed Shehzad at long on from the bowling of Afridi, his 300th wicket in one-day internationals.
The departure of his captain sparked Silva, who did not find the boundary until the 67th delivery he faced, into life. Twice in succession he swept Rehman to the fence, before pulling both Gul and Akhtar for fours.
But after Angelo Matthews was caught in the deep off Afridi and Thisara Perera was bowled by Akhtar, Silva ran past a wide from Rehman and Kamran this time made no mistake in completing the stumping.
Kulasekara, who hit 24 from 14 balls, left Sri Lanka needing 18 from the final over, but Gul kept his nerve as Sri Lanka tasted a first ever World Cup defeat on home soil.
Earlier, after winning the toss, Pakistan lost Shehzad (13) caught behind from a flat-footed waft at Perera before Hafeez and Kamran added 48 for the second wicket.
With the boundary easier to find against the hardness of the new ball, Hafeez (32) lifted Kulasekara over square leg for the only six of the innings but he departed in comical fashion at the beginning of the 13th over.
After sweeping Muttiah Muralitharan's first ball of the match to short fine leg, Hafeez failed to respond to Kamran's call, resulting in both batsman meeting at the striker's end.
Wicketkeeper Sangakkara received the ball and then threw wildly over Muralitharan's head, but there was enough time for Sri Lanka to return it to the bowler with both batsmen still 22 yards away. After some discussion, the umpires decided that Hafeez should be the man to depart.
Kamran fell soon after, stumped yards out of his ground after aiming to hit Rangana Herath down the ground, to leave Younus and Misbah the task of consolidating.
The experienced duo responded to the task. With boundaries hard to come by, the Pakistan pair settled for working the ball into the gaps and running well - their 100 partnership came up in 113 balls but featured only four fours.
Younus eventually fell after hitting four boundaries in his 76-ball effort, top-edging a sweep off Herath to short fine leg, to leave Pakistan without his services when they opted to take the batting powerplay.
With Muralitharan back into the attack and having Umar Akmal (10) caught at deep midwicket, Sri Lanka were able to exercise some control, with Pakistan adding 36 runs in the five overs of fielding restrictions, a total boosted by Afridi's 16 from 12 balls.
But batting with a runner Misbah, who had accelerated after reaching a 65-ball half-century, was still there at the end, guiding Pakistan to what a total that, while far from daunting, ultimately proved beyond Sri Lanka.
MATCH SCORECARD