Defending champions France edged past England 2-1 on Saturday as Harry Kane missed a late penalty in the World Cup quarterfinals, after Morocco became the first African team ever to reach the last four.
France will face the surprising north Africans in a semifinal on Wednesday, earning their place when Olivier Giroud's header proved the difference at Al Bayt Stadium.
In a tense match, Aurelien Tchouameni's strike opened the scoring with 17 minutes gone, but Kane brought England level from the penalty spot early in the second half.
England were the best side for large parts of the match, but Giroud scored when it mattered most, rising above Harry Maguire to nod the ball into the net on 78 minutes for his 53rd goal for France.
As England desperately searched for an equalizer, they were thrown a late lifeline when Theo Hernandez needlessly shoved over Mason Mount and the referee gave a spot-kick following a VAR review.
But Kane blasted his kick high over the crossbar, spurning the chance to send the game into extra time.
He was the first England player to sink to his knees at the final whistle, his head in his hands.
"We gave them a little ammunition with two penalties, but it is with hearts and guts that we held onto this result," France coach Didier Deschamps said.
"It's fabulous because it was a big match against a very good English team.
"We responded once again, it's wonderful to reach the last four again, you have to savor it, a World Cup semifinal is quite something."
England coach Gareth Southgate said he had told his players, "I don't think they could have given any more."
"They've played really well against a top team. It's fine margins and things at both ends that have decided the game," Southgate added.
Moroccan joy
Only the most fervent Morocco fan would have bet on their side reaching the World Cup semifinals before the tournament kicked off.
On Saturday, they beat Cristiano Ronaldo and Portugal 1-0 thanks to Youssef En-Nesyri's first-half header to go further than any African team ever has at a World Cup.
Morocco, ranked 22 in the world before the tournament started, have surpassed the three other African sides to reach the quarterfinals -- Cameroon in 1990, Senegal in 2002 and Ghana in 2010.
Ronaldo, who came on as a second-half substitute, was unable to rescue his side and at the final whistle walked off down the tunnel wiping away tears without acknowledging either his teammates or the victorious Moroccans.
Ronaldo, 37, who with Lionel Messi has dominated world football for the past two decades, has likely played his last World Cup match after making a world record-equaling 196th international appearance at the Al Thumama Stadium in Doha.
The Moroccans have wildly surpassed expectations in Qatar and coach Walid Regragui lauded the battling spirit of his injury-hit side.
"We're drawing on all we have, we still have guys injured. I told the guys before the match we had to write history for Africa. I'm very, very happy," Regragui said.
As their national team made history, crowds gathered in Casablanca and chanted "Qualified! Qualified!"
There were also celebrations across the Arab world and in Europe as Morocco are also the first Arab team to reach a World Cup semifinal.
"My heart will stop, what a team, what stamina, what an achievement," Ilham El Idrissi, a 34-year-old woman, told AFP in Casablanca.
Argentina and Lionel Messi will face 2018 losing finalists Croatia in the other semifinal after the Croatians dumped out pre-tournament favorites Brazil on Friday.
The five-time champions crashed out in dramatic fashion, losing on penalties after a 1-1 draw, while Argentina survived a fightback from the Netherlands to also win in a shootout.
Brazil star Neymar said he was contemplating retiring from international football after the crushing loss, but on Saturday Brazilian legend Pele urged him to "keep inspiring us."
"I'm 82 years old, and after all this time, I hope I've inspired you in some way to get this far ... Your legacy is far from over," Pele wrote on Instagram.
Neymar had equaled Pele's official Brazil scoring record of 77 international goals in Friday's match.