Hours after a Pakistani army spokesman announced late Monday that the country’s Inter-Services Intelligence (ISI) and Afghanistan’s National Directorate of Security (NDS) had signed a deal to increase intelligence sharing and cooperation, many within the Afghan parliament criticized the deal, terming it as “shameful.”

“Pakistan is the enemy of Afghanistan, and such an agreement with Pakistan will never be for the benefit of Afghanistan,” Ahmad Shah Ramazan, an Afghan lawmaker from the northern Balkh province, reportedly said. “When it [the agreement] is put before the parliament for approval, it will be strongly rejected.”

Under the agreement, which was signed sometime last week, Pakistan will help train and equip Afghan intelligence officers, take part in the interrogation of terror suspects and conduct joint operations, the Express Tribune, a Pakistani daily, reported. However, Afghan officials have so far denied that the deal includes a provision for the training of Afghan officers by Pakistan.

“Both spy agencies will cooperate in fight against terrorism,” Ajmal Ubaid Abidi, spokesman for the president of Afghanistan, reportedly said. “Afghanistan and Pakistan face same threats and the agreement is aimed at exploring ways on how to continue fight against common threats.”

NDS Chief Rahmatullah Nabil refused to sign the deal “despite enormous pressure,” the Guardian reported, citing leaks to Afghan media. The agreement was then signed by a deputy director general of the NDS, whose name has not been revealed.

“It has not only heavily damaged morale within NDS but further damaged the credibility of Ghani and the national unity government,” Davood Moradian, a Kabul-based analyst, told the Guardian.

The deal marks a potential breakthrough in relations between the two Asian neighbors. Both countries have, in the past, accused the other of fomenting unrest in the region and sheltering militants. Although both sides have toned down their rhetoric since the election of Ashraf Ghani as the president of Afghanistan, many in the country still accuse Pakistan’s spy agency ISI of having close ties with the Haqqani Network -- a Waziristan-based group believed to be responsible for carrying out several attacks in Afghanistan.