Jason Roy smashed 114 and Ben Stokes finished on 71 not out as England chased down a target of 341 with three deliveries to spare to win the fourth one-day international against Pakistan and clinch the series on Friday.
England moved into an unassailable 3-0 lead ahead of the last game of the series on Sunday.
Pakistan made 340/7 at Trent Bridge mainly thanks to Babar Azam's 115 off 112 balls. There was a scare for Pakistan ahead of the World Cup when opener Imam-ul-Haq was struck on the elbow by a delivery from paceman Mark Wood and went to the hospital, but he returned to bat at the end of the innings.
Stokes got England over the line, though, pacing the chase to perfection in the final overs with Tom Curran also weighing in with an important 31 off 36 balls.
Top-ranked England hosts the World Cup, which starts on May 30.
(With AP Inputs)