Powered largely by a 163 run partnership for the fourth wicket between Shoaib Malik and Safraz Ahmed, Pakistan avoided a series whitewash by winning the fifth ODI by 4 wickets at Sophia Gardens in Cardiff.
Set a target of 303 runs to win, Pakistan eclipsed England's total with ten balls to spare.
England had earlier managed 302 for 9 in their fifty overs, Jason Roy (87) and Ben Stokes (75) top scored as the hosts looked to have set a challenging total despite a late innings collapse.
Apart from Roy and Stokes, no English batsman passed fifty in an innings with plenty of starts but not much in terms of big scores, Jonny Bairstow's 33 was the next highest score.
Hasan Ali finished as the best Pakistan bowler in terms of figures with his haul of 4 for 60, while Mohammad Amir managed to take 3 for 50 from his ten overs.
Pakistan looked to be struggling after being reduced to 77 for 3 in the 14th over with Mark Wood dismissing Babar Azam (31) and Azhar Ali (33) within the space of three balls. Chris Woakes had earlier removed Sharjeel Khan for just 10.
That brought together Pakistan's heroes Shoaib and Safraz. The pair put on a swashbuckling 163 runs off 143 balls to put the tourists in charge. Safraz struck ten fours and a six on his way to 90 off just 73 balls.
Safraz and Shoaib (77) would fall in the 38th and 40th overs respectively and when Mohammad Nawaz (2) was run out in the 43rd over Pakistan would have had their hearts in their mouths but Mohammad Rizwan and Imad Wasim put on a unbeaten stand of 38 to guide Pakistan to their only win of the ODI series by four wickets with ten balls to spare.
The pick of England's bowlers was Woof who finished with figures of 2 for 56.
England and Pakistan conclude their hostilities with a T20I on Wednesday at Old Trafford in Manchester.