The 41-year-old all-rounder made his debut in 2003 and went on to play 55 Tests, 218 one-day internationals and 119 Twenty20 internationals, scoring 12,780 runs across the three formats and claiming 253 wickets overall.
He last donned Pakistan colours in their T20 World Cup semi-final defeat by Australia in Dubai in November. His last ODI was against Bangladesh in 2019 while his final Test appearance came a year earlier against New Zealand.
“Today I say goodbye to international cricket with pride and satisfaction,” Hafeez, who will continue to play club cricket having signed up with Lahore Qalandars for the Pakistan Super League T20 competition, told reporters.
“In fact, I have earned and accomplished more than I had initially envisaged and for that, I’m thankful to all my fellow cricketers, captains, support staff and the PCB who helped me out during my career.”
Hafeez made his name as an opening batsman but also proved to be a handy off-spinner in white-ball cricket, topping the International Cricket Council rankings for bowlers and all-rounders in August 2012 and January 2013.
He was also ranked the number one T20 all-rounder in March 2014.
“His game evolved with time, adjusting to different formats quite intelligently,” PCB Chairman Ramiz Raja said.
“Later in his career, he became a T20 specialist, where he was never out of touch with modern demands of this testing format. His batsmanship took a sprightly turn, nailing sixes almost at will.”