"We've waited 36 years," one fan cried after the Atlas Lions beat Canada 2-1 to storm into the round of 16 as winners of their group.
In 1986, the football-obsessed North African nation became the first African or Arab country ever to reach the knockout stages, before many of the current players were born.
Morocco had gone from a draw with Croatia to a spectacular win on Sunday against Belgium before beating Canada, a huge boost for coach Walid Regragui, who has been in the job for just three months.
Regragui said the team is dreaming of going further than the last 16 - even winning the tournament.
"We set ourselves an objective - we said we wanted to give everything we've got and get out of the group stages. We can tick that box now," Regragui said.
"Right from the beginning I have been talking about changing our mindset," he added.
"We didn't come here just to play and say 'We almost qualified (for the last 16)'.
On Thursday, the iconic Avenue Mohammed V in Morocco's capital city, Rabat, was thronged with supporters wrapped in the country's red flag with its green star, setting off firecrackers as drivers honked their horns.
Heavy rain, a welcome sight in the drought-stricken country, cleared up before the final whistle as men, women and children poured into the streets to celebrate.
Cafes had been packed for the match and even banks had closed early to allow people to watch.
"I was stressed about the match but they blew us away," said Houda, 34, who was watching at a cafe with her daughter.
Maths teacher Mehdi Dida said his joy had "no limits."
"It's a historic moment to see the Moroccan flag so high and see our players give their all for their country," he said.
One social media user wrote that people his father's age continually talked about the team of 1986.
"In 20 years' time, I'll be able to tell my children about the team of 2022," he wrote. "It's historic!"
Morocco will face Spain on December 6 in the Round of 16.