Afghan and US officials said a Pakistani effort to seal the border contributed significantly to a peaceful voting day in the Afghan presidential election last October.
"Pakistan helped with security during the presidential election, with securing the border," Interior Minister Ali Ahmad Jalali said after talks with visiting Pakistani Interior Minister Aftab Ahmed Khan Sherpao.
"Our hopes are that Pakistan would help us the way they helped in the presidential election, with the parliamentary election, and they promised to cooperate," Jalali said.
Pakistan-Afghan relations had dipped lightly in the wake of the US-led invasion of the country in 2001 due to Taliban attacks from camps in Pakistan.
Taliban attacks on government and foreign forces increased in the south and east of Afghanistan in recent months. Hundreds of people have been killed and worry is mounting over security for the 18 September parliamentary polls.
Sherpao told reporters earlier that Pakistan was clearing its western border of fighters, many of whom had crossed the frontier from Afghanistan.
"The way Pakistani forces have reacted in the fight against terror shows that we don't want our soil and borders to be used for terrorist activities," Sherpao said.
"After the 9/11 incident, as our border with Afghanistan is very long, it was not possible to control properly and a lot of foreigners came to Pakistan," he said, referring to foreign al-Qaida members fleeing US troops in Afghanistan.
"Our fight against them continues," he said.
Pakistan has been battling al-Qaida-linked militants along its Afghan border since last year. Hundreds of Pakistani troops and militants have been killed.
Taliban attacks against foreign
and local forces have increased
But some US officials, while welcoming the action against al-Qaida members, have said Taliban fighters can still find safety in Pakistan.
Sherpao, attending the opening of a school rebuilt with Pakistani aid, said his country would help Afghanistan in areas such as education and health.
Pakistan supported the Taliban until the September 11 attacks on the United States when it threw its support behind the US-led war against terrorism.