With temperatures in London rising to 36.7 degrees Celsius (98 Fahrenheit), the 40-year-old Mahmood showed he still knew how to finish with a flourish as his unbeaten 22 off 14 balls saw Surrey to victory.
Gloucestershire's 20-year-old quick Craig Miles was the bowler to suffer, pulled over deep square leg for six by Mahmood off the final ball of the game as Surrey just got past the visitors' 154 for five.
Mahmood had also driven the second ball he faced, from slow left-armer Tom Smith, for six.
Gloucestershire did not help their cause by sending down nine wides -- including one from Miles at the start of the last over -- and two no-balls in the closing stages.
After the match, Mahmood said: "I knew when I connected that it would be six. I had missed the previous ball, which was also short, and I thought the last one would also be short.
"There was a bit of a delay between the last two balls, as they discussed with the bowler what he was to do, and that helped me because I had a little bit more time to get myself calm and collected," he added.
Gloucestershire captain Michael Klinger refused to blame Miles for the defeat.
"Craig bowled a fantastic last over to get them from wanting nine off six balls to six from the last ball. He also executed exactly what we asked him to do with that last ball -- so there's no blame on him," the Australian insisted.
Need a six to win off the last ball?
— Cricket News (@cricketnews2day) July 2, 2015
No problem for Azhar Mahmood:https://t.co/PRQLyPKorL
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ