The soccer tournament was originally scheduled to take place in Libya. However, Libya withdrew as hosts last year because of a civil war.
It will be the second time that Gabon has staged the AFCON finals after they were co-hosts with Equatorial Guinea in 2012.
Gabon will use four venues for the 16-team tournament, which will be played in January and February. The venues will be Libreville and Franceville, which were used in 2012, plus Port-Gentil and Oyem, where the stadiums will be ready in 14 months’ time.
All three candidate countries made presentations to the CAF executive committee on Wednesday before the ballot was taken. CAF did not make details of the voting immediately available.