Morocco was awarded the hosting rights for the 2015 African Cup of Nations by the Confederation of African Football executive committee on Saturday.
Morocco beat out competition from South Africa for the 2015 tournament. South Africa was awarded the 2017 version.
The countries were the only two bidding for the 30th and 31st editions of the Cup of Nations after Congo withdrew from the race last year, meaning CAF's 15-man executive committee only had to decide in which order Morocco and South Africa would hold the two tournaments up for grabs.
The bid teams made their final presentations on Saturday to the executive committee, under the chairmanship of President Issa Hayatou.
CAF also announced Morocco will host the 2013 Africa Under-17 Championship and Rwanda will stage the 2016 African Nations Championship.
Morocco convinced CAF this time after losing out to South Africa in a 2004 FIFA vote to host the 2010 World Cup _ the first in Africa.
The north African country has hosted the African Cup once before, in 1988. It won its only title in 1976.
Morocco has built new stadiums in Fes, Marrakech and Tangiers, adding to existing venues in Casablanca and the capital, Rabat.
South Africa's bid team included World Cup organizing committee chief executive Danny Jordaan, who was now a vice president of the South African Football Association.
South Africa has also hosted the African Cup once before, when it won in 1996.
Gabon and Equatorial Guinea had already been chosen as the venue for the 2012 African Cup. Libya will host in 2013, when it is moved to an odd year to avoid clashing with the 2014 World Cup.
Morocco's successful 2015 bid gives north Africa back-to-back tournaments.