The visit in December by Hassamuddin Hassam, acting head of the National Directorate of Security, was an apparent indication of the two sides narrowing their strategic differences, the Dawn newspaper quoted its sources as saying.
Hassam visited Islamabad after a suicide attack targeting NDS chief Assadullah Khalid.
The Afghan government had claimed the attack was planned in Quetta and President Hamid Karzai had accused an unnamed foreign intelligence agency of having masterminded it.
Though Hassam's visit primarily focused on investigations into the attack on Khalid, it also led to improved relations between the military and intelligence agencies of the two countries, the report contended.
Two Afghan nationals were arrested by Pakistani authorities in connection with the suicide attack.
The Dawn quoted its sources as saying that the Afghan spy agency was satisfied by the investigation and cooperation by Pakistan.
Information about Hassam's visit was provided to the Standing Committee on Defence of the Senate or upper house of parliament during an in-camera briefing by officials of the Defence and Foreign Ministries yesterday.
Members of the Senate panel will travel to Afghanistan on March 25 for the first parliamentary dialogue between the two countries on defence issues.
The committee's chairman, Mushahid Hussain Sayed, said the three-day dialogue will act as a "force multiplier" for bilateral ties.
Relations between Afghanistan and Pakistan have been marked by distrust and the two sides have had angry exchanges in recent months on issues like terrorism and the activities of militants along the border.
Ethnic issues, border disputes and differences on counter-terrorism strategies have been major sources of divergence between the neighbours and "lingering mistrust between their spy agencies widened the gulf", the report said.
The visit by the acting NDS chief was followed by the first visit to Pakistan by Afghan Defence Minister Gen Bismillah Mohammadi, which further improved ties.
During the visit, Mohammadi offered to give Pakistan a role in training the Afghan National Army.
Pakistan and Afghanistan have also agreed on a structured military and intelligence dialogue and their army chiefs, heads of intelligence and directors general of military operations have been meeting regularly.
The arrest of a high-ranking Pakistani Taliban leader Maulvi Faqir Mohammad by the NDS in late February was seen as a major step towards building trust.
An unnamed Pakistani diplomat referred to difficulties at the political level and said they were related to President Karzai's "sense of insecurity".
Last year, Pakistan released 26 middle ranking Afghan Taliban leaders to build confidence and to boost the peace process in Afghanistan. However, the process was later put on hold.
Islamabad: A secret visit to Pakistan by the acting chief of the Afghan intelligence service last year has led to improved ties between the military and intelligence agencies of the two countries, according to a media report on Friday.
First Published: Friday, March 22, 2013, 15:49