Pakistan were chasing a target of 279 runs in the third ODI
Paceman Blessing Muzarabani took career best figures of 5-49 as Zimbabwe beat Pakistan in a thrilling super over finish in the third and final one-day international on Tuesday.
The actual match finished in a tie after tailender Musa Khan hit the final delivery of the 50th over from Richard Ngarava for a boundary to level the scores at 278.
But player of the match Muzarabani dismissed Iftikhar Ahmed and Khushdil Shah for two runs on four balls in the super over which Zimbabwe scored off just three balls without any loss.
Despite the defeat Pakistan won the three-match series 2-1.
Azam, who finished with a run-a-ball 125 with 13 boundaries and a six, led Pakistan's fightback and stood firm after Pakistan were set a daunting 279-run target.
He added a match turning 100 for the seventh wicket with Wahab Riaz who made 52.
With 28 needed Riaz held out off Muzarabani, Babar took the fight by smashing a six in the 49th over to reduce the target to 13 off the final over.
When he finally got the strike off the last ball, Pakistan needed five which resulted in a boundary.
Muzarabani's previous best figures of 4-47 came against Afghanistan at Bulawayo two years ago.
The series gives Pakistan 20 points and Zimbabwe ten in the One-Day Super League, the qualification process for 2023 World Cup in India.
Pakistan won the first match by 26 runs and the second by six wickets, also in Rawalpindi.
Zimbabwe's total of 278-6 was built around a fighting unbeaten 118 by Sean Williams who helped his team recover from paceman Mohammad Hasnain's best figures of 5-26.
The win broke Zimbabwe's sequence of ten consecutive defeats and gave them only their fifth win over Pakistan in 62 ODIs.
Zimbabwe's pace trio of Muzarabani, Ngarava (2-62) and Donald Tiripano (2-39) left Pakistan snaring at defeat with the score at 6-151.
Debutant Khushdil scored 33 and added 63 for the sixth wicket with Azam.
Earlier, Williams's 135-ball knock for his fourth ODI hundred lifted Zimbabwe from a precarious 22-3 after they won the toss and batted.
It was 20-year-old paceman Hasnain who shook the tourists by removing Zimbabwe skipper Chamu Chibhabha (nought), Craig Ervine (one) and Brian Chari (nine) in his first four overs of hostile fast bowling.
Williams added an invaluable 84 runs for the fourth wicket with Brendon Taylor (56) and another 75 for the fifth with Wesley Madhevere (33) to stage a fightback.
Dropped three times on 73, 75 and 81, Williams finally reached his hundred with a couple off paceman Wahab Riaz, much to the jubilation of the Zimbabwe dressing room.
He hit 13 boundaries and a six in his knock.
Taylor, who scored a century in the first game on Friday, hit eight boundaries before falling to a miscued cut off Hasnain.
Hasnain, who had five wickets in his first five matches, had Madhevere caught off his own bowling to improve on his previous best of 2-52 against Australia in Dubai last year.
Williams and Sikander Raza, who made a 36-ball 45, cut loose in the final overs adding 96 runs for sixth wicket, piling on 46 in the last five overs.
The teams will now play three Twenty20 internationals on November 7, 8 and 10 — all in Rawalpindi.