Opening bowlers Umar Gul (1-11) and Mohammad Hafeez (2-12) left West Indies reeling at 16-3 before Ramnaresh Sarwan and Shivnarine Chanderpaul cautiously guided their team past the 50 mark in the first of the quarterfinals.
But legspinner Afridi's introduction into the attack accounted for Sarwan, who made a tortuous 24 off 68 balls, and West Indies then collapsed to 71-8 after losing four wickets in nine balls.
Chanderpaul (44 not out) and Kemar Roach (16) at least took West Indies past its lowest total at the World Cup before Afridi (4-30) finished off the innings in the 44th over by bowling Ravi Rampaul for 0 to take his tournament-leading tally to 21 wickets.
West Indies captain Darren Sammy had warned before the game that if his batsmen collapsed as they did against England and India in their two previous games that they would be "going home." After Wednesday's effort, that is very likely.
The day began well enough for West Indies when Sammy won the toss and chose to bat on a slow-paced pitch.
He obviously didn't account for the West Indies batsmen throwing away wickets in the manner they did.
Chris Gayle returned to the top of the order having missed the game against India but after thumping two fours, he was gone by the end of the third over, mistiming a lofted drive off Gul that went straight to Afridi at midoff.
Devon Smith never looked comfortable against either of Pakistan's opening bowlers and it was spinner Hafeez who had him trapped lbw in the sixth over.
Smith asked Sarwan if he should refer the decision to the third umpire, only to be quickly sent back to the dressing room by his teammate. Darren Bravo did go to the review, but to no avail and he fell in the same over to another lbw decision.
At 16-3, the lowest score at Mirpur looked under threat. That was the 58 Bangladesh managed in the group stage - against West Indies. However, the experienced heads of Sarwan and Chanderpaul began an exercise in occupying the crease.
At one stage there were 19 straight dot balls and by the end of the 12th over, West Indies' runrate was 1.83. Sarwan's glance down to fine leg in the 13th over was his team's first boundary since Gayle's in the third.
Sarwan made 24 off 68 balls but the hard work went to waste when he played a loose drive straight to Umar Akmal at point to give Afridi his 18th wicket of the tournament - and more quickly followed.
Kieron Pollard and Devon Thomas fell in the space of two Afridi balls in the 27th over, and West Indies proved no more adept in dealing with the offspin of Saeed Ajmal, who accounted for Sammy and Davendra Bishoo in the next over.
Chanderpaul, who had returned to the side after being left out of the last two games, and Roach took West Indies past the 93 it managed against Kenya at the 1996 World Cup, but there was little else to celebrate.