Comments by Advisor to the Prime Minister on Foreign Affairs Sartaj Aziz came after Pakistani forces stepped up actions against the militants in the border region and killed nearly 50 militants in two days.
"The two countries have also agreed not to let anyone use their soil against each other," he said.
Pakistan and Afghanistan share a nearly 2,600-km-long porous border and both countries are discussing options to put in place a mechanism to check illegal movement of militants.
Pakistan army chief, General Raheel Sharif, rushed to Afghanistan Wednesday a day after a group of Taliban militants killed nearly over 140 people, mostly children, in an attack on a military-run school in Peshawar.
The army said that the army chief had shared"vital intelligence" with Afghan officials concerned with regard to the Peshawar attack.
Some sources said Pakistani security officials had intercepted telephonic conversation of the Afghanistan-based militants who were giving instructions to the school attackers.
Security officials said that senior Pakistani Taliban commanders, including their chief Maulvi Fazallulah, operate from the Afghan side of the border. Kabul has never admitted Pakistani Taliban have taken shelter in Afghanistan.
Aziz said Afghan President Ashraf Ghani had pledged during his visit last month to Pakistan that he would not let his country's border be used for terrorism.
He said Pakistani and Afghan officials would meet within two weeks to discuss measures for effective border control, adding that Pakistan was the country worst affected by terrorism in the world.