Mohammad Hafeez hit his third century in four matches to help Pakistan move into an unassailable 3-1 lead over Sri Lanka with an eight-wicket win in Abu Dhabi.
Hafeez made 113 not out to ensure Pakistan comfortably reached their victory target of 226 with 53 balls to spare in the penultimate match of the one-day series between the two nations.
Having won the toss, Sri Lanka slipped to 36-3 at one point and although half-centuries from Kumar Sangakkara and debutant Ashan Priyanjan bolstered their total to 225 all out, it never looked like being enough in a match they had to win to level things up with one to play.
Umar Gul did the early damage at the top of the tourists' order, removing Kusal Perera with his fourth ball before then going on to knock back Tillakaratne Dilshan's off-stump in his next over.
The same bowler also had Dinesh Chandimal caught in the covers, forcing Sangakkara (51) and Priyanjan to undertake a repair job in a partnership worth 89.
Priyanjan was eventually bowled for 74 by Junaid Khan after trying to work the left-arm seamer to fine leg with a paddle sweep; from then on Saeed Ajmal took control.
The spinner claimed 4-39 in 9.5 overs to see Sri Lanka dismissed with seven balls remaining, Angelo Mathews one of his victims when he was trapped leg before for 38.
Pakistan's run chase was given an excellent start by Ahmed Shehzad, who hit three fours in an over off Nuwan Kulasekara on his way to making 44 from 56 deliveries.
Sharjeel Khan was dismissed by Mathews' first ball for 13 but that allowed the in-form Hafeez to come in and make his ninth ODI century.
His knock, which included 12 fours and two sixes, saw him combine with Sohaib Maqsood (46 not out) to steer their team over the line with an unbroken alliance worth 111 for the third wicket.
The final one-dayer takes place on December 27 at the same venue ahead of a three-match Test series.