Esmaeil Gholizadeh opened the scoring for Iran in the 73rd minute, before Nassim Azaouzi scored the equalizer for the Atlas Lion Cubs (90th + 4).
The two teams headed towards the fateful penalty shootout, which wrapped up with a large 4-1 win for Morocco thanks to an exceptional performance of goalkeeper Taha Benrhozil, elected man of the match.
In the quarter-final game, scheduled for Saturday at Manahan Stadium in Surakarta, the national team will play Mali, which knocked off Mexico (5-0).