In Brussels, police sealed off parts of the city centre, deployed water cannons and fired tear gas to disperse crowds, the riot coming after Belgium's defeat and Morocco's first win at a World Cup since 1998, only the third in their history.
Leaders from the group-stage begin to emerge with Canada's bid over despite scoring their first-ever goal in the World Cup.
Entry into the knockout-stage for Group E teams will be tightly contested as Japan face Spain on Friday.
Japan 1-0 Costa Rica
Group E
Costa Rica showed real resilience to bounce back from their 7-0 thrashing by Spain to record a surprise 1-0 victory over Japan in Group E of the Qatar World Cup.
Keysher Fuller scored in the 81st minute for Costa Rica on Sunday, leaving both teams with three points after two games in the World Cup.
Fuller took advantage of a defensive error when Japan failed to clear their lines and then made a second mistake by playing him onside.
Fuller took deliberate aim from the edge of the area and his precise shot just made it into the net off the fingertips of Japan's goalkeeper, Shuichi Gonda, who should have done better.
The match at Ahmad Bin Ali stadium was tactical and largely lacklustre, particularly in a first half that did not yield a single shot on goal.
Morocco 2-0 Belgium
Group F
Morocco pulled off another shock at this unpredictable World Cup, beating Belgium 2-0 to leave Kevin De Bruyne and the 2018 semifinalists in danger of failing to make the knockout stage.
Substitute Abdelhamid Sabiri broke the deadlock on Sunday when he outsmarted Belgium goalkeeper Thibaut Courtois by whipping in a free kick from a tight angle at the near post in the 73rd minute.
Belgium and Courtois could not say they hadn't been warned: just before halftime, Morocco had a very similar free kick, taken by Hakim Ziyech, ruled out.
Romain Saiss was marginally offside and referee Carlos Ramos ruled the goal out after a VAR review as the Besiktas defender was obstructing Courtois' view.
When Sabiri struck, Saiss was again the man running across the near post, but this time he was onside.
Zakaria Aboukhlal then guided a shot into the roof of the net from a pass by Ziyech in stoppage time, to the delight of the deafening support for Morocco at Al Thumama Stadium.
IN OTHER NEWS:

Croatia 4-1 Canada
Group F
Andrej Kramaric scored twice for Croatia as they ended Canada's hopes of advancing at their first World Cup in 36 years with a 4-1 victory in Group F.
Alphonso Davies scored Canada's first-ever World Cup goal with a towering header on Sunday, in just the second minute.
But the 2018 runners-up responded with two goals from Kramaric, plus strikes from Marko Livaja and Lovro Majer.
Croatia and Morocco, who caused another upset by beating Belgium 2-0 earlier Sunday, both have four points from two matches. Belgium have three points but still have a chance to advance.
Canada are out, though, despite an energetic performance from John Herdman's team and a blistering start.
Spain 1-1 Germany
Group E
Germany have given themselves hope of avoiding another early World Cup exit by snatching a 1-1 draw with Spain as substitute Niclas Fuellkrug fired home an 83rd minute equaliser.
The result leaves Germany facing a must-win match against Costa Rica in four days' time and also means Spain have yet to book their spot in the knockout phase of the tournament.
Germany were looking in danger of suffering another early exit from the World Cup, after being eliminated following the group stage in 2018, before Fuellkrug took advantage of Jamal Musiala's battling in the box to fire high into the net past Unai Simon in Spain's goal.
Alvaro Morata, himself a substitute, had increased the jeopardy for the Germans when he neatly flicked in a cross by Jordi Alba to score for Spain in the 62nd minute.
Germany went into their encounter against Spain at the Al Bayt Stadium under immense pressure after suffering a shock defeat to Japan in their opening match.
- with Australian Associated Press