The 26-year-old had been charged by the International Cricket Council with "conduct unbecoming... which could bring (players or officials) or the game of cricket into disrepute."
Afridi jabbed his bat aggressively in the direction of a spectator after being dismissed in the first one-day international against South Africa at Centurion on Sunday as he walked up the stairs.
Pakistan have two more one-day internationals left in South Africa before their World Cup campaign starts on March 13 against West Indies in Jamaica.
ICC match referee Chris Broad said in an ICC statement on Saturday: "I took into account what I considered to be the mitigating circumstances of a spectator in close proximity to the player shouting at him as he returned to the dressing room.
"I also spoke to the spectator in question ahead of the hearing to get his version of events.
"However, I found it impossible to escape the conclusion that Mr Afridi's actions were a clear threat to that spectator, and had that person not taken evasive action then the bat would almost certainly have hit him."
"Such an act is completely unacceptable and on that basis I found the player guilty of the Level 3 offence."
Broad also commented on the specific situation in which the incident arose.
"For the record, I do not believe spectators should be that close to the players or that they should feel they can shout whatever they like and think that is acceptable," he said. "That is a view I have expressed to Cricket South Africa."
Afridi has 24 hours to appeal and, should he do so, he would be able to play until any new decision was made.
Afridi decides not to appeal: Meanwhile Afridi has decided not to appeal against a four-match one-day international ban handed down for pushing his bat at a spectator.
Pakistan coach Bob Woolmer said the player had decided not to exercise his option of lodging a written appeal within 24 hours.
An unsuccessful appeal would have delayed Afridi's ban and he might have missed Pakistan's first four World Cup matches in the West Indies next month.
Instead, he will miss the last two matches of the series against South Africa, as well as Pakistan's first two World Cup matches, against the West Indies and Ireland.