Romain Saïss put Morocco in front in the 73rd minute, when he glanced the ball in at close range after a free kick whipped in from the left by Abdelhamid Sabiri deceived Belgian goalkeeper Thibaut Courtois at the near post.
Kramarić would score again in the second period before Lovro Majer took advantage of a miscontrolled ball by Kamal Miller in the dying moments of the match to complete a 4–1 Croatian victory that sealed Canada's elimination from the tournament.
The first half finished goalless, with the most noticeable incident coming when Croatia was awarded a penalty following a foul by Yannick Carrasco on Andrej Kramarić, before being cancelled due to the VAR deeming Dejan Lovren marginally offside in the buildup to the call.
Belgium, needing a victory to avoid elimination unless Canada defeated Morocco by four goals in the concurrent match played, would bring on record goalscorer Romelu Lukaku for the second period, marking his return to action following a spell out due to injury.
Lukaku missed several notable chances to score, including a strike that hit the inside of the post, as Belgium was unable to capitalize on their opportunities and succumbed to a 0–0 draw, eliminating them after Morocco defeated Canada 2–1.
Although Canada captain Atiba Hutchinson's header from a corner would strike the bar and the goal line in the second half, Morocco held on to win the match 2–1.
Canada, meanwhile, joined hosts Qatar as the only teams to exit the tournament without a single point, and remained winless in their World Cup history, adding on to the three defeats they suffered in 1986.