Hafeez scored a run-a-ball 80 with eight fours and a six while Babar notched a 60-ball 54 after Pakistan won the toss and decided to bat on another flat Gaddafi Stadium pitch.
Hafeez gave Pakistan a sound start of 115 with skipper Azhar Ali, who made 46, before Babar and Anwer (38 not out) gave the score a significant boost in the final overs with sublime batting.
Pakistan lead the three-match series 2-0 after winning the first game by 41 runs and the second by six wickets -- both in Lahore.
Security was enhanced around the stadium and team hotel after Friday night's blast which police said was a cylinder explosion while federal information minister Pervez Rasheed described it as a failed suicide attack which killed two people.
Also Read
Nevertheless Zimbabwe decided to continue with the tour.
Ali was run out in the 20th over as he failed to complete a single. He hit four boundaries and a six during his 59-ball knock.
Raza then came into his own, trapping Hafeez with a sharp delivery before dismissing Asad Shafiq (16) and Sarfraz Ahmed (25) to improve on his 2-25 against Afghanistan at Bulawayo last year.
Babar kept his cool, reaching his maiden fifty off 54 balls with four boundaries before being bowled but he and Anwar helped Pakistan add 54 in the last five overs.
Zimbabwe were forced to make two changes with unfit Brian Vitori and Tawanda Mupariwa making way for Chris Mpofu and Roy Kaia.
Pakistan brought in Babar and Junaid Khan in place of Haris Sohail and Mohammad Sami.