Afghanistan created history as they claimed their first-ever series win against a top-five ICC-ranked ODI team, dominating South Africa with a 177-run victory in the second match.