Japan was knocked out of the World Youth Championship in a cruel fashion on Tuesday after a last-gasp goal from Mouhssine Iajour gave Morocco a 1-0 win in Enschede to put his side into the last eight.

Sota Hirayama went close to winning it for Japan in the final minute of normal time but with extra time looming, it was Iajour who showed his class, converting a 92nd-minute opportunity to claim victory for Morocco.

Japan almost took the lead after 15 minutes when Yohei Kajiyama capitalized on a goalkeeping error by Moroccan custodian Mohammed Bourkadi, only for the North African defense to clear its line.

Jubilo Iwata forward Bobby Cullen saw his 20-meter drive hit the woodwork five minutes later and he then was left ruing his luck when a deflected effort hit the bar.

The Moroccans started strongly after the interval but again it was Japan who had the first sight of goal when Mizuno fired over the bar.

Japan coach Kiyoshi Okuma remained optimistic despite the defeat and said he was pleased with his side's overall performance.

"In contrast to the earlier games in the championship, today we showed what Japanese football has to offer," Okuma said.

"Unfortunately, we could not get the right result. Obviously I am very disappointed. The players gave their all, but overall I am very pleased with my team," he said.

Morocco coach Jamal Fathi was delighted with the result.

"That was a very difficult game for us," Fathi said. "Japan were very strong. There had to be a winner and a loser, but I think we deserved the victory. It was a very even game in the first half, although Japan hit the post and the bar."