"I've been feeling unwell since Thursday; my body had been aching badly. I've been tested and unfortunately I'm covid positive. Need prayers for a speedy recovery, InshaAllah," Afridi announced on Twitter.
Afridi played for Pakistan between 1996 and 2018, featuring in 27 Tests (1716 runs and 48 wickets), 398 ODIs (8064 runs and 395 wickets) and 99 T20 Internationals (1416 runs and 98 wickets).
He remains involved in the game and was last seen on the field in the Pakistan Super League in March.
Afridi is also actively involved in his charity work as the head of a foundation named after him. Following the coronavirus outbreak, he was seen outdoors on many occasions, mainly for his charity work.
Wishes of a speedy recovery started pouring on social media soon after Afridi made the announcement.
Another former Pakistan international Taufeeq Umar, had also tested positive for coronavirus but he recovered earlier this month.
At least two Pakistani first-class players have died from the infection with leg-spinner Riaz Sheikh passing away in Karachi earlier this month.
Sheikh, a leg-spinner who took 116 wickets in 43 matches, died in his home.
Another Pakistani first-class player, Zafar Sarfaraz, 50, died due to the virus in April in Peshawar.