Open this photo in gallery:

Canada defender Luc de Fougerolles, centre, laments Morocco's third and final goal in the World Cup round of 16 in Houston on Saturday.Hannah McKay/Reuters

Canada’s World Cup adventure is officially over.

The tournament co-hosts fell to a 3-0 defeat to Morocco in Houston on Saturday, with the reigning African champions moving on to the quarter-finals as a result.

The Canadian men’s national team gave a good account of itself in defeat, driving much of the play in the first half, but was unable to make it count.

Morocco regrouped after halftime, scoring twice through Azzedine Ounahi with Soufiane Rahimi adding a third goal to push its world-record unbeaten run to 34 matches.

Ranked seventh globally, the Moroccans are attempting to return to the semi-finals for the second straight tournament.

They move on to play the winner of France-Paraguay in Boston on Thursday, leaving Canada to reflect on its missed opportunities following an exit from a men’s World Cup at which it ventured further than ever before.

Open this photo in gallery:

Morocco players celebrate midfielder Azzedine Ounahi's second goal on Saturday.RONALDO SCHEMIDT/AFP/Getty Images

Open this photo in gallery:

Midfielder Stephen Eustáquio and forward Cyle Larin process the loss, which denied Canada a spot in the World Cup quarter-finals.Frank Gunn/The Canadian Press

It had all started so promisingly for Jesse Marsch’s team, which reached the round of 16 for the first time in national history by eliminating South Africa in Inglewood, Calif., last weekend.

In the buildup to the Morocco game, NASA had wished America a happy 250th birthday in a recorded message, and the Canadians took the field dreaming of the stars. They started in a similarly hopeful vein.

Through 45 minutes, you’d have been hard-pressed to identify which of the two teams had made the semi-finals four years ago. Canada managed 13 touches in the Moroccan box to just one the other way.

Tani Oluwaseyi had the most promising of those, taking a feed from Ali Ahmed and getting by his marker, only to see his left-footed shot saved by Yassine Bounou’s extended leg.

After that aggressive start, the last 10 minutes of the half established a much more physical pattern to the game. Both sides gave as good as they got, forcing English referee Michael Oliver to go to his pocket often, issuing two yellow cards to Canada (Richie Laryea and Jonathan David) and four to Morocco.

That level of aggression made it the first World Cup match on record (since 1966) to see more bookings than shots (five) in the first half.

Live analysis and commentary about Canada's tournament-ending loss

Both sides had the opportunity to cool off during the interval, which also allowed the Moroccans to push the reset button.

All the good work Canada had done in the opening 45 minutes was undone in a few moments.

Luc de Fougerolles, who moments before had volleyed over the Moroccan goal following a corner, had to scramble back as Rahimi threatened to get away, crudely cutting him down near the touchlines and earning a yellow card.

The free kick was simplicity personified. Morocco captain Achraf Hakimi rolled the ball across the top of the penalty area, and Ounahi had as much time as he needed to crash the ball low into the net.

Open this photo in gallery:

Ounahi opens the scoring in the 50th minute.Hannah McKay/Reuters

Falling behind was always going to increase the size of the obstacle that Canada was looking to scale. Not only did Morocco come into the match on a record 33-game unbeaten run, but the Atlas Lions had avoided defeat in their past nine World Cup matches when scoring first, a run that stretches back to the 1970 tournament.

Once in front, Morocco’s confidence grew and grew. As Canada pressed to try to find a way back into the game, more space began to open up in its own half.

That allowed the speed of Morocco to come to the fore, with a number of desperate moments as the African champions surged forward, often undone by a wayward final ball.

Marsch decided to tinker with his frontline just after the hour mark, bringing on Cyle Larin in place of Oluwaseyi, but Larin’s biggest contribution was a yellow card for a clumsy challenge on Bounou less than five minutes after coming on.

There was a glimmer of hope when Stephen Eustáquio was hauled down from behind on the edge of the area in the 78th minute – just inches from being a penalty. But David could only float the resulting free kick over the bar, and another chance had passed Canada by.

Open this photo in gallery:

Jonathan David, right, and three Canadian teammates were booked during Saturday's contentious match.Hannah McKay/Reuters

With 11 minutes remaining, Marsch went to his bench again, bringing on Promise David and Jacob Shaffelburg for Laryea and Ahmed. Noticeably, there was no sign of Alphonso Davies getting ready for action.

Three minutes later, any realistic hope of a comeback was gone, as Ounahi doubled his output for the day, crashing home a cutback from Brahim Diaz into the top corner.

Canada got a let-off with five minutes remaining when Rahimi’s header came back off the crossbar. But the striker got another chance deep into injury time, and this time he made the most of it, taking a pass from Diaz and rolling it past Maxime Crepeau.

Open this photo in gallery:

Soufiane Rahimi, right, and Achraf Hakimi celebrate the last Moroccan goal.RONALDO SCHEMIDT/AFP/Getty Images

Open this photo in gallery:

Coach Jesse Marsch, centre, applauds Canadian fans in Houston at the end of Saturday's game.Molly Darlington/Getty Images

Follow related authors and topics

Authors and topics you follow will be added to your personal news feed in Following.

Interact with The Globe