It was not clear where the decision to ban the apps originated. The letters to the service providers were sent by the Ministry of Communications and Information Technology. But an official there, who spoke on the condition of anonymity because he was not authorized to discuss the matter publicly, said the request had come from the National Directorate of Security, the country’s intelligence agency.

The official said the spy agency had asked the Ministry of Communications to test a 20-day ban on the two apps. He did not provide a reason for the request, but WhatsApp and Telegram are often used by the Taliban and other militant groups to evade government surveillance.

On Thursday, the deputy director of the telecoms regulatory authority told the BBC that the ban was due to “security concerns.”

But later Friday, the Ministry of Communications gave an entirely different explanation, in what appeared to be a face-saving response to criticism of the ban. It said that the apps were being temporarily banned “to introduce a new kind of technology,” because users had complained about the quality of WhatsApp’s service.

The statement also denied that the ban constituted a threat to free expression. “WhatsApp and Telegram are just applications for contact and the sending of audio messages, and this does not affect freedom of speech,” it said.