Al Ahly secured third spot at the FIFA Club World Cup following a 3-2 penalty shootout win over Palmeiras.
Palmeiras endured more penalty pain as Al Ahly's 3-2 shootout success after a goalless draw clinched third place at the Club World Cup.
Andre-Pierre Gignac's semi-final spot-kick had sent Tigres UANL through to the final at the expense of the Copa Libertadores winners and the margins were even finer in Thursday's play-off.
A dismal stalemate prompted the penalty drama, with the takers scarcely more accurate from 12 yards than they had been in the prior 90 minutes.
Mohamed El-Shenawy saved a straightforward Rony effort and watched Luiz Adriano send a truly dreadful attempt wide, but Weverton's sublime stop from Amr El Soleya and Marwan Mohsen's agonising strike against the post kept the sides all square.
Junior Ajayi's outstanding finish into the top-right corner piled on the pressure, though, and Palmeiras captain Felipe Melo was denied by El-Shenawy.
It was a fitting end to a match in which Melo's defensive error had provided the clearest opening.
He failed in an attempt to chip a pass over Walter Bwalya and then slipped, allowing El Soleya to seize the ball and run clear, only to drag his finish wide.
There was also a sprawling El-Shenawy save from Rony's header before the break.
Weverton was grateful for an offside flag midway through a similarly tame second period as he parried El Soleya's volley straight to substitute Ajayi, whose follow-up effort was struck off.
But penalties were required to separate the sides and again proved Palmeiras' undoing.