Afghan media have reported that Afghanistan's National Directorate for Security wanted the ban to stop the Taliban and other insurgent groups from using encrypted messages.
Afghanistan on Monday overturned a temporary ban on WhatsApp and Telegram following outcry among social media users who had branded the move an attack on free speech.
Internet providers had been ordered by the industry regulator to block the popular messaging apps from November 1 to November 20 to "resolve technical problems", the communications ministry said last week.
But at a meeting on Monday Afghan President Ashraf Ghani and Chief Executive Abdullah Abdullah decided "there will be no ban on Whatsapp & Telegram", Abdullah tweeted.
President @ashrafghani and Chief Executive Abdullah met today & decided that there will be no ban on Whatsapp & Telegram in #Afghanistan.— Dr. Abdullah (@afgexecutive) November 6, 2017
A statement issued by the presidential palace said Afghanistan's constitution guaranteed the right to freedom of speech and "the National Unity government is committed to protecting those values".
Facebook-owned WhatsApp and Telegram are widely used by Afghans and terror groups including the Taliban and Daesh. The attempt to ban them had sparked anger among users.
"Blocking WhatsApp and Telegram is the beginning of censorship by the Afghan government and bringing the virtual world under their control in Afghanistan. I think this is intolerable," one Facebook user wrote.
But the Ministry of Communications and Information Technology denied the suspension was an attempt to restrict freedom of speech and said it was considering introducing a "new technology".
Testing was "time-consuming" and required the temporary stoppage of WhatsApp and Telegram," acting communications minister Shahzad Aryobee said in a Facebook post on Friday.
State-owned Salaam Network was the only internet provider to obey the order, communications ministry spokesman Najib Nangyalay said on Saturday.