Pakistan all-rounder Shahid Afridi announced his retirement from international cricket. (AFP)

Highlights Shahid Afridi has been playing internationally for 21 years

Afridi said he'll play for Pakistan Super League for 2 more years

Nicknamed 'Boom Boom', Afridi had been a fan favourite since 1996

Even after retirement, Shahid Afridi will continue to play for Pakistan Super League for 2 more years.

Shahid Afridi already quit Tests in 2010 and ODI cricket after the 2015 World Cup

Legendary Pakistan all-rounder Shahid Afridi on Sunday announced his retirement from international cricket, ending an illustrious and sometimes controversial 21-year career. The 36-year-old star had already quit Tests in 2010 and ODI cricket after the 2015 World Cup but still skippered the Pakistan Twenty20 team at the 2016 world championships in India. He stepped down as captain after the tournament although he retained slender hopes of continuing his career in the sport's shortest format as a player. "I have said goodbye to international cricket," said Afridi after smashing a 28-ball 54 in a Pakistan Super League match for Peshawar Zalmi in Sharjah."I am playing for my fans and will continue to play this 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."Nicknamed 'Boom Boom', Afridi had been a fan favourite since he burst onto the scene in 1996, striking a 37-ball one-day century against Sri Lanka in only his second match to set a world record that was unbeaten for 18 years.He became known as a leg-spin bowling all-rounder in the second half of his career and was instrumental in Pakistan's early successes in Twenty20, including their 2009 victory.After stopping short of retirement following Pakistan's first round exit at the 2016 World Twenty20, Afridi had wanted to play a farewell Twenty20 match against West Indies in United Arab Emirates in September.But selectors, with one eye on the future, did not pick him in the squad.His blistering breakthrough century in Nairobi in 1996 was only surpassed by New Zealand's Corey Anderson's 36-ball hundred against West Indies at Queenstown in 2014.South African AB de Villiers then bettered the record further with a 31-ball century, also against the West Indies, at Johannesburg in 2015.Afridi's rapid-fire century in Kenya made him an instant hit with the crowds who expected fireworks every time he strolled to the crease.Sometimes he delivered but too often for some, his death or glory approach brought his downfall.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.He was also banned for two Twenty20 internationals after he was shown on television biting the ball during a one-day international against Australia at Perth in 2010.Afridi finishes his international career having played just 27 Test matches which yielded 1,176 runs with a highest score of 156 and 48 wickets.

He played 398 one-day internationals with 8,064 runs, a highest score of 124 while taking 395 wickets with his leg spin.His Twenty20 international CV saw him play 98 matches with 1,405 runs and a career-leading 97 wickets.