Ahmad becomes only CAF's seventh president, as Hayatou was attempting to win an eighth straight term at the CAF congress in Ethiopia's capital Addis Ababa on Thursday.
Hayatou had been the president of CAF since the year 1988, and Ahmad Ahmad's victory had brought a new dawn to African football.
Ahmad, 57 and a former player and coach, heads the FA of a less prominent African football country, but under Caf rules a candidate for president has to be a serving member of the executive committee, and he was encouraged by allies to make the challenge.
Mwendwa, alongside 53 other Africa based Football Association's presidents, will on Thursday vote for the next president of the continental football body.
The result was greeted by cheers at the CAF congress as Ahmad was carried on the shoulders of jubilant supporters to the podium after the result was announced.
It started with the Fédération Internationale de Football Association (FIFA) when in 2015 the then president Sepp Blatter resigned over an ongoing corruption scandal ending his 17 year reign, he has subsequently received a 6 year ban from football.
Africa would also seek more places at FIFA's age group competition and criticised the decision of world football's governing body to close two of its development offices on the continent.
Ahmad won 34-20 in the vote of Africa's 54 member federations.
The Cameroonian's political antennae let him down when he ordered CAF to back the wrong horse in Asian president, Sheikh Salman bin Ebrahim Al Khalifa.
However, repeated calls to Nzamwita, who was still in Addis Ababa where the election was held, went unanswered.
Ahmad is already a member of the CAF executive and he has been promised the support of the 14 member Council of Southern African Football Associations (COSAFA).
The second step is to develop African football.
Hayatou, in charge for almost three decades, has often been re-elected unopposed.