"Today I wish to inform my fans in Pakistan and all over the world that I am relinquishing the captaincy of the T20 Pakistani team of my own volition," Afridi said in a statement posted on his official Twitter account.
"On this day, I thank Allah (SWT) for His Kindness and Mercy which enabled me to discharge my leadership duties to the best of my abilities, for the sake of the honour and prestige of my motherland."
Pakistan were knocked out of the World T20 after losing three of their four group matches, including a loss to arch rivals India.
The national side's next assignment is an away tour to England which will consist of four Tests, five ODIs and a one-off Twenty20 match.
"For me it was a great honour to lead my country in all three formats of the game. My profound thanks to the PCB and its chairman Mr. Shahryar Khan Sb, Who gave me the honour to lead the national team," Afridi wrote further.
"I would also like to inform that InshaAllah I intend to continue to play the game for my country and league cricket etc, and request my fans to kindly keep praying and supporting me for my best future performances for Pakistan (as a player); and in all other arenas of the game, world over."
After the Pakistani cricket team's disappointing dismissal from the World T20 in India, Afridi took to Facebook last week to ask forgiveness from cricketing fans all over the country for what he termed his failure to meet the nation's expectations.
Afridi scored less than 100 runs in four matches and failed to take responsibility when the side needed it most.