Pakistan's President Pervez Musharraf says his country will work to make sure cross-border terrorism does not affect the coming Afghan elections. Afghan President Hamid Karzai's visit to Pakistan coincides with a pledge to free hundreds of Pakistanis his government has imprisoned.
The Pakistani president says his country is committed to stopping Afghan anti-government militants from using Pakistani territory as a haven.
Pervez Musharraf promises a total effort by Pakistan before Afghanistan's first post-war presidential election on October 9.
But, speaking at a news briefing with Afghanistan's transitional president, Hamid Karzai, Mr. Musharraf admitted that curbing all cross-border attacks will be a difficult task.
"There is a possibility that terrorists from our side are going into Afghanistan to disrupt the law and order there and cause casualties," Mr. Musharraf says.
He added that both sides need to work together, sharing intelligence and other assets.
Mr. Karzai says his country is also doing its best to curb the insurgency, led by remnants of the Afghanistan's former Taleban regime.
Pakistan's Foreign Ministry said Tuesday that the Afghan delegation also pledged to release all four hundred Pakistani nationals imprisoned in Afghanistan in the near future.
Many of the prisoners were captured while fighting alongside the Taleban in the 2001 war that toppled the conservative religious government.
President Karzai also touched on bilateral trade issues, a key subject for Pakistan, which hopes to run a gas pipeline linking it to resource-rich Central Asia.
"Afghanistan will be open for trade with Pakistan, and Afghanistan will be open for transit activity from Pakistan, through Afghanistan, to the Central Asians," Mr. Karzai says.
Mr. Karzai ended his two-day visit to Islamabad Tuesday evening.