England squandered the opportunity for a series whitewash as Pakistan claimed a consolation four-wicket win in the fifth one-day international in Cardiff. The tourists slipped to 77-3 chasing England's total of 302-9 and appeared to be on their way towards another demoralising defeat, before Sarfraz Ahmed (90) and Shoaib Malik (77) shared a stand worth 163.
And while England claimed wickets in the closing overs, Pakistan were able to steer their way towards a much-needed victory with ten balls to spare.
Earlier in the day, Pakistan won the toss and elected to field on a grey day in south Wales. England started brightly thanks to 87 from Jason Roy and Ben Stokes' 75, but lost wickets at regular intervals and ultimately had to scrap their way towards a competitive total.
Pakistan had Hasan Ali, who took 4-60, and Mohammad Amir (3-50) to thank for ensuring England did not make an intimidating score and putting themselves on the road towards a series whitewash.
The tourist's captain, Azhar Ali, subsequently admitted he was thrilled to have finished the one-day series on a positive note.
"We wanted to finish on a high. We have had a tough tour. It was a much-needed victory for us," he said during the post-match presentation, according to Cricinfo. "We pulled it back brilliantly, the bowlers deserve credit after we conceded too many runs to start with."