drawing 1–1 with South Africa. Morocco qualified to the knockout stages, facing Algeria; they eventually won 3–1 in extra time, and 4–0 against Mali in the semi-final. They lost the 2004 African Cup of Nations Final against Tunisia 2–1. In 2012, the national team won the Arab Cup, topping their group, defeating Iraq in the semi-final and Libya in the final. In 2014, Morocco participated for the first time in the African Nations Championship after failing to qualify in the 2009 and 2011 editions. led by coach Hassan Benabicha, Morocco did not make it past the second round after losing 3–4 to Nigeria in the Quarter-finals. They managed to qualify for the 2016 African Nations Championship, but were eliminated in the group stages. Morocco hosted the 2018 African Nations Championship, which included a victory for the home nation, the third North African country to win the competition's title. Second Golden Generation (2017–present) Morocco returned to the World Cup after a 20-year absence in 2018. The North Africans were drawn in Group B with World Cup favourites Spain, Portugal, and Iran. In their opening game against Iran, Morocco showed full dedication but lost 10 in the final minutes of the match, scored by an own goal. In their second game, Morocco faced Portugal but ended losing 1–0 by a goal scored by Cristiano Ronaldo. In the last match against Spain they took the lead 2–1 but was unable to keep it, and drew 2–2, scored by Khalid Boutaïb and Youssef En-Nesyri. Morocco entered the 2019 AFCON with high confidence and players claiming them to be the favourites to win. However, in spite of three straight group stage wins, Morocco were shockingly knocked out by Benin in the round of sixteen. At the 2020 African Nations Championship in Cameroon, Morocco won their second CHAN title, in its second consecutive final appearance. Captained by Ayoub El Kaabi, they defeated Togo (1–0), Rwanda (0–0), the Uganda (5–2), Zambia (3–1), and Cameroon (4–0) on the way to a final against Mali in Yaoundé. Morocco won 2–0, with both goals scored late into the second half by Soufiane Bouftini and Ayoub El Kaabi. Morocco thus became the first team to win back-to-back titles. Soufiane Rahimi went on to be named Total Man of the tournament after an astonishing performance scoring a total of 5 goals. In December 2021, Morocco started its venture at the 2021 FIFA