Afridi told a news conference on Sunday that he will focus on T20 matches after the tournament is over, as Pakistan look ahead to the T20 World Cup in India in 2016.
He said: “I am the first Pakistan player to be able to announce his retirement properly and on a high. I always wanted to do this having seen the problems faced by other bigger players in the past.
“Having taken a decision it is a big burden off my mind and I am confident I will be able to focus on giving my best in the World Cup.
“It was not an easy decision to take and I think many of my seniors also found it difficult to go out at the right time. But no one is indispensable in cricket and I am sure sooner or later someone will take my place in ODIs as well.???
The experienced all-rounder once held the ODI record for the fastest century, storming to the mark in just 37 balls, only to be bettered by New Zealand???s Corey Anderson this year.
Afridi has played 389 one-day internationals for Pakistan and recently stepped in as captain after an injured Misbah-ul-Haq pulled out.
The 34-year-old, who retired from Test matches in 2010, is closing in on completing 400 wickets and 8000 runs in ODIs – he has 391 and 7870 respectively – and hopes he can reach this landmark at the World Cup.
Afridi has been named captain of the national T20 side by the Pakistan Cricket Board.