A below-par Portugal were again rescued by Cristiano Ronaldo's eye for goal as they stumbled to 1-0 victory over Morocco on Wednesday that meant the unlucky North African side become the first to be eliminated from the 2018 World Cup.
Ronaldo headed his fourth goal of the tournament after four minutes, following his last-gasp equaliser in a hat-trick in the 3-3 draw with Spain, to take the European champions to four points and top of Group B. Iran have three points and Spain one ahead of their meeting later on Wednesday.
Morocco, who had a real go at the Luzhniki Stadium but failed to convert their chances, are pointless having also lost 1-0 to Iran and cannot progress to the second round.
Portugal struggled to impose themselves and ended up defending for long spells, leaving coach Fernando Santos unimpressed. "We have to look at this, we lost control of the game," he said.
We misplaced a lot of passes, we lost confidence… it was inexplicable. If in a match against players like they have, if you don't have the ball, they wear you down and you get into trouble.
Despite their battling display, Morocco will rue the unforgivable defending that made all their subsequent good work irrelevant – though they claimed a Portuguese foul was at the root of it.
They qualified for the finals without conceding a goal in six matches yet somehow opted against marking the most dangerous attacker at the tournament in the six yard box when Joao Moutinho swung in a cross from a short corner and Ronaldo duly buried the header.
It was his 85th international goal, taking him beyond Hungarian Ferenc Puskas's European record, with only Iran's Ali Daei ahead of him on 109.
Morocco coach Herve Renard said he was unhappy at what he felt was a foul by Pepe on Khalid Boutaib that opened the way for the goal.
"We put a man at the front post and when there is a crude foul on this man who is prevented from getting to the ball, it passes over and it's Cristiano Ronaldo who pops up," he said.
Morocco, in their first finals appearance for 20 years, regrouped well and showed some real positivity in attack with Hakim Ziyech and Nordin Amrabat seeing plenty of the ball. Amrabat was furious at not being awarded a penalty after wrestling with Raphael Guerreiro.
The midfielder had begun the game with head protection after being seemingly knocked unconscious against Iran five days ago in a sight that will have left medical professionals fuming about football's feeble concussion protocols.
"I'm not a doctor. He is a warrior who wanted to play," said Renard, echoing the refrain that has caused so much damage to sportsmen for decades.
When they did manage to stop appealing and concentrate on playing, Morocco looked dangerous and were the dominant side in the second half.
Portugal goalkeeper Rui Patricio made a fantastic diving low save to touch clear Younes Belhanda's sharp header but Medhi Benatia's blazed effort over the bar was more typical of their finishing from half-a-dozen reasonable chances and they paid the ultimate price for their lack of a proven goalscorer.
Portugal have no such concerns and will seek to win the group in their final game against Iran, while Morocco face Spain, both on June 25.
Watch: Highlights from FIFA