South Africa managed to recover from two significant defeats to secure a seven-wicket victory against Afghanistan in the final match of their One Day International Series in Sharjah on Sunday.

Aiden Markram's unbeaten 69 and Tristan Stubbs' 26 not out helped South Africa reach 170 for three wickets in just 33 overs, in response to Afghanistan's modest total of 169.

Afghanistan had previously dominated South Africa, winning the first match on Wednesday and delivering a 177-run thrashing on Friday, putting them 2-0 up in the three-match series. However, they were unable to maintain their form in the third ODI, even after winning the toss and choosing to bat.

Their innings was once again highlighted by the powerful hitting of opener Rahmanullah Gurbaz, who scored 105 in Friday's victory. This time, he fell short of another century, scoring 89 off 94 balls before being caught on the boundary by Reeza Hendricks off Andile Phehlukwayo's bowling.

For the rest of the team, poor decision-making and some misfortune led to three runouts. Rahmat Shah was run out when a ball hit back down the wicket by Gurbaz was deflected by Lungi Ngidi's hand onto the shoulder of the stranded Shah, knocking his wicket over. Captain Hashmatullah Shahidi and Ikram Alikhil were also slow to make their ground and were run out by quick thinking in the field, causing Afghanistan to slump to 132 for seven before Allah Ghazanfar's unbeaten 31 off 15 helped them surpass 150.

South Africa were always on track to reach the target, even after losing their opening three batsmen for 80 runs. Markram took the lead with aggressive batting, while Stubbs supported him, resulting in an unbeaten 90-run partnership that secured South Africa's victory.