Rassie van der Dussen's century was the cornerstone of South Africa's imposing 333-5 as the Proteas threatened to spoil England star Ben Stokes's farewell to one-day international cricket on Tuesday.
Van der Dussen made a career-best 133 and shared a partnership of 151 with Aiden Markram (77) after putting on 109 with opener Janneman Malan (57).
South Africa's total might have been greater had not both Markram and van der Dussen fallen in the same over from spinner Liam Livingstone.
Markram, who faced just 61 balls and struck nine fours, holed out in the deep to Jonny Bairstow and, two balls later, a tired van der Dussen, was bowled trying to muscle a slower ball that kept low.
Dynamic all-rounder Stokes announced on Monday that Tuesday's game at his Durham home ground in Chester-le-Street would be his 105th and last ODI, with the now Test captain saying the demands of a congested fixture schedule made it impossible for him to give of his best across all three international formats.
Tough spell for Stokes
He led the team on to the field but an expensive bowling return of 0-44 in five overs left his loyal fans in the northeast hoping to witness some batting heroics from Stokes, the player of the match in England's 2019 World Cup final triumph.
England made three changes to the side that lost the third ODI, and with it a three-match series, against India at Old Trafford on Sunday.
They gave a debut to seam bowler Matthew Potts with Adil Rashid, who missed the India series while on the Hajj pilrgrimmage, and Sam Curran returning in place of the in-form Reece Topley, David Willey and Craig Overton.
Potts, who impressed for England after making his Test debut against New Zealand last month was given his first ODI cap by fellow Durham paceman Mark Wood, one of several currently injured England fast bowlers.
South Africa stand-in captain Keshav Maharaj, leading the side in place of the injured Temba Bavuma, won the toss and decided to bat first amid a heatwave gripping England.
Quinton de Kock was bowled early on by Curran before Malan and van der Dussen took charge.
Malan was first of the pair to reach fifty, off 63 balls, before van der Dussen got there in just 45 balls.
The second-wicket duo were eventually separated when Malan chipped off-spinner Moeen Ali to deep midwicket.
Van der Dussen kept going and a leg-glanced boundary off Curran saw him to a 90-ball hundred including nine fours. It was the 33-year-old's third century in 36 ODIs and first against England.
Van der Dussen was dropped on 121 when Bairstow, running in from midwicket, failed to hold a difficult low chance off Moeen, and went on to surpass his previous highest ODI score of 129 not out against India at Paarl in January this year.