This will be only the second time the 2022 FIFA World Cup semi finalists will be hosting Africa's showpiece event, having also previously done so in 1988.
Guinea had originally been chosen to host the tournament in 2025 but concerns over the country's infrastructure saw them stripped of the hosting rights.
Zambia, Algeria, Benin and Nigeria were all in the running to host Afcon 2025 but withdrew their bid at the eleventh hour.
"The decision that was taken today was to focus on African unity, development and growth, in the context of those countries withdrawing," Confederation of Africa president Patrice Motsepe said of Morocco's success.
"A huge amount of money is being spent on Morocco for 2025. The bid from Morocco to host the World Cup is not just for Morocco, but for the whole of Africa."
Additionally, Uganda, Kenya and Tanzania will co-host the 2027 edition of the Africa Cup of Nations.
"The three nations came together because our standards and requirements are very high," added Motsepe, likening expectations for the organisation of tournaments to those held by European administrative body Uefa and the South American Football Confederation (Conmebol).
"Sometimes it requires hundreds of millions - sometimes billions - in infrastructure. It makes me proud when football brings countries together. Afcon 2027 is going to be a huge success."
Ivory Coast are due to host the next edition of Afcon in January next year.