Hafeez earned the man-of-the-match award for his 84 from 62 balls as he punished England for dropping him when he was on 14.
Also Read: Joe Root urges calm despite Pakistan loss
It was a remarkable result for Pakistan, who made 348-8, just days after they were thrashed by the West Indies in their first match of the tournament.
They proved a much tougher opposition against England and Hafeez put that down to the whole squad producing their best at key moments.
"Everyone was believing we could do this. We were playing good cricket but not winning crucial stages of the game," he told Sky Sports.
"Everyone chipped in today and gave everything which was required to win the game.
"We needed one winning performance and then everyone contributed accordingly. It was a total team effort. It is a very happy dressing room."
"It was a great team effort. Bowlers bowled really well. We tried a couple of different things. We started with Shadab because we know their openers are not good against spin," he said.
"Fielding is a very important part. In the last ODI series, it was different. Today we feel better and we bowl better."