ISLAMABAD, Pakistan — A prominent Taliban official who served as the group’s spokesman during some of its most devastating attacks, including the attempted assassination of the young activist Malala Yousafzai, has escaped from detention in Pakistan, claiming he had made a secret deal with the country’s security forces.

If verified, the claim by the Taliban militant, Sajjid Mohmand, also known by his nom de guerre, Ehsanullah Ehsan, would bring renewed scrutiny to the country’s ties to the group. Pakistan’s security and intelligence forces have long been accused of harboring terrorist groups to use for their foreign and domestic policy objectives, which they have denied.

“I have been in detention for three years and I honored the deal with great patience for three years,” Mr. Mohmand said in an audio recording that was released on social media on Thursday. “In the near future, I will make more revelations about the deal and people involved in it.”

When reached by phone on Friday, Mr. Mohmand confirmed the authenticity of the audio recording and added that he and his family were in hiding. A spokesman for Pakistan’s military declined to comment on Friday.