The authorities in Afghanistan have released 49 Pakistani prisoners they say were fighters for the Taleban.
Mr Jamali [L] and Mr Karzai promised to increase co-operation
The prisoners - held in the capital, Kabul - were freed following an order from President Hamid Karzai.
Both Afghanistan and Pakistan have promised to release nationals being held in each others' jails.
Earlier this week, Pakistani Prime Minister Zafarullah Khan Jamali pledged to increase security along the Pakistani side of the border.
Mr Jamali ordered the release of some Afghan nationals serving terms in Pakistani prisons for immigration violations last Sunday.
The jailed Pakistanis were handed over to officials from Islamabad by Afghan intelligence service officers on
"They are all former Talibs arrested in different parts of Afghanistan," Mohammed Harun Asefi, a police commander at the Interior Ministry told the Associated Press news agency.
"I hope they go to their country and get an ordinary job."
Many Pakistanis were rounded up by Afghanistan's security forces after the fall of the Taleban regime in December 2001.
Pakistan's deputy ambassador in Kabul, Abdel Hamid Afridi, said many of the Pakistani prisoners had been "cheated and deceived" by Islamic radicals who ordered them to fight a holy war in Afghanistan.
"They were told that you have to go for jihad. This is all unfortunate," he told the Associated Press.
One of the former fighters released on Thursday also said he had been "misled".
"I was a student of a madrassa (religious school) in Peshawar. One of the mullahs told us the Russians were back in Afghanistan and that they would invade Pakistan," he said.
Pakistan says at least 500 of its nationals are being held in prisons throughout Afghanistan, many in its northern city of Sheberghan.
Afghanistan has previously accused Pakistan of ignoring Taleban and al-Qaeda fighters saying they freely cross the border.
It has also said Afghan militants have come to regard Pakistan as a relative safe haven.
The Pakistan military has launched a number of offensives against suspected al-Qaeda militants in the country's tribal region that borders Afghanistan.
The most recent operation was last week in South Waziristan.