Jonny Bairstow scored a century and Test captain Joe Root 91 in England’s final warm-up match before the one-day series against South Africa.
England made 346-7 in 50 overs against a South Africa Invitation XI in Paarl.
Because of power cuts, the hosts batted for 20 overs and were then set 85 from 10 overs to test England’s bowlers – a target they reached with two balls to spare.
The three-match ODI series starts in Cape Town on Tuesday.
It will be England’s first 50-over international since winning the World Cup for the first time in July last year.
After England won the toss, Bairstow reached 100 off 83 balls before retiring out, while Root faced 89 deliveries before he was bowled by Stephan Tait.
Joe Denly contributed 85 then took two wickets, while Matt Parkinson took three in an over. Jacques Snyman scored 22 off Saqib Mahmood’s final over.