Herve Renard has resigned as coach of Morocco shortly after a disappointing Africa Cup ended with a last 16 exit to outsiders Benin.
"It is time for me to close this long and beautiful chapter of my life, not without some emotion and sadness but it is an inevitable decision taken well before AFCON 2019," the 50-year-old Frenchman wrote on social media.
Morocco were considered a favourite in the Africa Cup, won on Friday by Algeria, but lost on penalties in the first knock-out round after winning all three group games.
"We had all hoped better for this AFCON 2019 in Egypt," Renard wrote. "But this is football ..."
Renard took Morocco to 47th from 81st in the world rankings since his 2016 appointment and led the team to the 2018 World Cup. The appearance in Russia was their first on the biggest stage since 1998.