The match ended 1-1 after 90 minutes and Morocco beat Iran 4-1 on penalties.
Esmaeil Gholizadeh was on target with a header in the 72nd minute for Iran and Nassim Azaouzi leveled the score in the 89th minute at the Gelora Bung Tomo Stadium in Surabaya, Indonesia.
Morocco are scheduled to play Mali, who defeated Concacaf champions Mexico in the last 16 on Saturday.
Hossein Abdi’s Iran started the campaign with a 3-2 win over titleholders Brazil in Group C.
The Persians lost to England 2-1 and beat New Caledonia 5-0 and advanced to Round of 16 as one the best third-placed teams.
MNA