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.
Roy's partnerships with James Vince (43) and Joe Root (36) helped England to 201-1 before the opener's departure saw the hosts collapse to 216-5 — with Jos Buttler and Moeen Ali getting ducks.
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)