LAUDERHILL, Fla. (AP) — Pakistan needed allrounder Shaheen Shah Afridi to show off his bowling and batting skills in a three-wicket consolation win over Ireland on Sunday as both cricket teams bowed out of their disappointing Twenty20 World Cup.

Afridi destroyed Ireland’s top-order batters with 3-22 and then smashed a couple of sixes in his unbeaten 13 off five balls as he guided Pakistan to a scrappy 111-7 in 18.5 overs to win its last Group A game. Captain Babar Azam was 32 not out and helplessly watched another batting collapse before Afridi’s little cameo came to Pakistan’s rescue.

After Pakistan won the toss and chose to bowl first, Afridi’s twin-wicket burst in the opening over had Ireland reeling at 2-2, and then 15-4 off the first three overs.

Left-arm spinner Imad Wasim grabbed 3-8 in four overs to restrict Ireland to 106-9 on a lively wicket which had been under cover for most of the last week because of heavy rain in Florida, which had prevented the previous three games at the tournament venue.

Pakistan, which failed to chase down a run-a-ball target against rival India and lost to the U.S. in a major upset, nearly messed up against a spirited Ireland bowling attack. At 52-2 after eight overs, it looked comfortable before Barry McCarthy (3-15) and Curtis Campher (2-24) sliced through the brittle middle-order and Pakistan slipped to 62-6 in 11 overs.

Abbas Afridi, playing his first game in the tournament, made 17 off 21 balls before he too holed out with 12 needed but Afridi ensured Pakistan didn’t lose.

Ireland finished last in its group with three defeats and its solitary point coming against the U.S. in a rain-abandoned game at the same venue. Pakistan finished third with four points behind qualifiers India and the United States.