He played 27 Tests, 398 ODIs and 98 T20s.
"I have already said goodbye; I am just playing this for my fans".
'Now my foundation is important for me. "I have played with seriousness and in a professional and in a professional way for my country", he added.
He said, though, that he wants to continue to play in Pakistan's domestic league for two more years. Having made his debut in 1996, Afridi has amassed 10,645 runs and picked up 540 wickets in 523 global matches, finishing as one of Pakistan cricket's most successful players.
The former player had told geo.tv last December that he had already played his last global match for Pakistan and doesn't aim for farewell match anymore.
Pakistan great Shahid Afridi has accepted his global career is probably over.
The decision, announced after the Pakistan Super League (PSL) final here on Sunday night, put an end to an illustrious and colour 21-year career. "I am playing it for my fans and I am enjoying it".
The 36-year-old quit Tests and one-day internationals in 2015, but wanted to keep playing Twenty20s despite stepping down as captain in April 2016.
Afridi's ability to score better than a run-a-ball enabled Pakistan to finish runners-up in the inaugural World Twenty20 in 2007 in South Africa.
Afridi's maverick style also brought him a one-Test and two-match ODI ban after he was charged with using his foot to tamper with the pitch during a Test against England in Faisalabad in 2005.