Chris Woakes took five wickets as England beat Pakistan by 54 runs to win the fifth one-day international at Headingley on Sunday.
Victory, in their final match before the World Cup hosts and favourites name their tournament squad on Tuesday, saw England to a 4-0 series win after the first match was washed out.Woakes took three wickets for no runs in nine balls as Pakistan slumped to six for three in pursuit of a target of 352.
Babar Azam (80) and captain Sarfraz Ahmed (97) then kept England at bay but both batsmen were run out and any lingering hope Pakistan had went with them.
Woakes needed just three balls to have Fakhar Zaman out, caught by Joe Root at second slip, out for a duck.
Abid Ali (five) was then lbw to Woakes, with Paul Reiffel's decision upheld on umpire's call.
Fast bowler Woakes then nipped one back to have Mohammad Hafeez lbw for nought, although replays suggested Reiffel's verdict may have been overturned if Pakistan had reviewed the decision.
Babar, however, carried on from his 115 in a three-wicket defeat at Trent Bridge on Friday with a 59-ball fifty before advancing down the pitch to drive off-spinner Moeen Ali for six.But a fourth-wicket partnership of 146 ended in frustrating fashion for Pakistan.
Sarfraz prodded at an Adil Rashid delivery and set off for a single.
But wicket-keeper Jos Buttler moved quickly from behind the stumps to throw the ball to the bowler's end where Rashid, with Babar trying to regain his ground, flicked the ball onto the stumps from behind his back without looking to complete a run-out.
A seemingly angry Sarfraz hit Rashid for four, six an four off successive deliveries.
But Rashid, in front of his Yorkshire home crowd, dismissed Shoaib Malik with a diving left-handed catch off his own bowling.
Safaraz was denied what would have been his third ODI hundred in bizarre fashion.
Buttler, having stopped the ball with his boot, saw the rebound fall kindly to run out Sarfraz, who narrowly failed to ground his bat in time.
Despite some late damage to David Willey's figures by Mohammad Hasnain, Pakistan were eventually all out for 297 in the 47th over.
Earlier, England were set for a huge score at 191 for two off 25 overs.
But several batsmen got themselves out, including Test skipper Root, who top-scored with 84, and one-day captain Eoin Morgan, who made 76 on his return to the side.
Root and Morgan put on 117 in 18 overs but it still needed tailender Tom Curran's unbeaten 29 to take England past 350.
Left-arm spinner Imad Wasim took three for 53, while fast bowler Shaheen Shah Afridi had four for 82 after striking at both ends of the innings.
But the last over saw Curran hit a six and then ramp an outrageous four off successive Hasan Ali deliveries.
Morgan, back after a one-game ban for slow over-rate offences, hit five sixes -- including one onto the roof of the Old Pavilion Stand off Mohammad Hasnain -- before a mistimed pull off Afridi was caught by Abid.
Root was even closer to a century when he holed out off Hasnain, having faced 73 balls including nine fours.