DOHA, Qatar (AP)Morocco goalkeeper Yassine Bounou leant back in his chair, shook his head and said: ”Pinch me, I’m dreaming.”

Yes, Morocco really is in the World Cup semifinals.

Before arriving in Qatar, the north African nation had only ever won two of its previous 16 matches at the World Cup. The team’s coach had been in position for just four months. Its players were talented but battling a culture of underachievement by the country at major soccer tournaments.

So, how has Morocco managed to top a group containing second-ranked Belgium and 2018 finalist Croatia and then eliminate Spain and Portugal – two of Europe’s soccer powerhouses – to become Africa’s first World Cup semifinalist and the pride of the Arab world?

The answer lies in a bold decision by its soccer federation and recently installed coach Walid Regragui’s unwavering belief in a game plan that’s being followed to the letter by a selfless and gifted group of players.

No team has been able to crack the code. Can France in the semifinals?

COACHING CHANGE

The foundation to this unlikely underdog story was built in August when Vahid Halilhodzic – an experienced Bosnian coach who guided Morocco serenely through African qualifying – was fired by the federation essentially because of his refusal to select Hakim Ziyech, one of the country’s best players. The federation cited ”divergent visions” as the reason for firing Halilhodzic and replaced him with Regragui, a former Morocco international who had just led Wydad Casablanca to the African Champions League title. Regragui was about to inherit the most talented Morocco squad in a generation.

SQUAD DEPTH

The team has never had so many players from top European clubs. The two full backs, Achraf Hakimi and Noussair Mazraoui, are starters for Paris Saint-Germain and Bayern Munich, respectively; winger Ziyech plays for Chelsea, albeit not so regularly; goalkeeper Bounou and striker Youssef En-Nesyri are at Sevilla in Spain; Sofyan Amrabat is the defensive midfielder at Fiorentina in Italy; center backs Nayef Aguerd is at West Ham in the Premier League, where captain Romain Saiss was recently playing for Wolverhampton. Regragui’s task was two-fold: to get his players functioning in a system that could get results at the World Cup and to get them believing they could shock the world. ”I told them, ‘You don’t come to the World Cup only to play three games,” he said. He has created a masterpiece.

TACTICS

Regragui sets his team up in a 4-1-4-1 formation, with the defense typically in a deep, low block and Amrabat sitting directly in front, never venturing forward. Against the supposedly bigger teams this World Cup, the four-man midfield line also has dropped further back to create another defensive shield, leaving En-Nesyri as the lone striker. When the opponent loses possession, Regragui has drilled his players to break forward on the counterattack at pace, using the energy of full backs Hakimi and Mazraoui to complement the mercurial skills of Ziyech and fellow winger Sofiane Boufal. From being isolated, En-Nesyri suddenly finds five or six teammates with him. The approach requires discipline and high levels of mental concentration. ”We have a clear game plan – everyone has to work,” Regragui. ”We are showing the world you can succeed even if you don’t have as much talent and money.”

THE NUMBERS

The statistics behind Morocco’s run are extraordinary. The team has only conceded one goal – and that was an own-goal by Aguerd against Canada – meaning Croatia, Belgium, Spain and Portugal have failed to break down Morocco. They have only allowed 10 shots on target in five games. They are averaging less than three shots on goal and surviving on an average possession of just 29.8% per game. Against Spain, Morocco had 343 passes and its opponent had 1,041. ”I don’t think they have ever run as much in their lives,” Regragui said. ”When you put in so much heart, you give yourselves a chance.”

FANS

Helping Morocco’s players is the backing they are getting at each game from fans who are streaming into Qatar to watch the historic run of the team nicknamed the Atlas Lions. Every match has felt like a home game for Morocco, whose passionate supporters greeted all the spells of possession by Spain and Portugal with ear-piercing whistles and jeers. The supporters have been ubiquitous in Doha, proudly carrying around the Morocco flag and wearing the team’s red jerseys. Their national’s team’s only major title was at the African Cup of Nations in 1976. Morocco is two wins away from dwarfing that and becoming the most unlikely World Cup champion.

Steve Douglas is at https://twitter.com/sdouglas80

AP World Cup coverage: https://apnews.com/hub/world-cup and https://twitter.com/AP-Sports