Pakistan President Pervez Musharraf met Afghan leader Hamid Karzai in Islamabad on Wednesday for talks to cope with the threat of extremism and terrorism, which he said was "destroying both our countries."
In a brief joint news conference after their first meeting in four months, both presidents said the talks had been helpful in addressing the threat of Al-Qaeda and Taliban militants who have flourished along their mutual border.
Both men have accused each other in the past of not doing enough to fight Islamic militants, particularly in the rugged tribal border region that has been in the international spotlight since the September 11 attacks on the US.
But in an apparently warm atmosphere before Musharraf was to host a state dinner for Karzai, he underlined the need for intelligence cooperation to fight the militant threat.
"We have to work together to function well for the mutual benefit of both the countries, and that is what Pakistan looks forward to," Musharraf said.
He said the neighbours had to work together to counter "this menace of extremism and terrorism, which is destroying both our countries."
Both nations are pivotal allies in the US-led "war on terror" and get substantial US aid aimed at fighting militants but both have also seen a sharp increase in violence this year.
This has been the deadliest year yet of the Taliban insurgency in Afghanistan, with some 6,000 people killed, while more than 770 people have died in militant attacks in Pakistan.
Karzai, who repeatedly referred to Musharraf as "my brother" during the news conference, said they had discussed issues of vital importance to the future of the two nations.
"We discussed them in sincerity and in a manner that enhanced our understanding," he said.
"People in both the countries are suffering suffering a lot," Karzai said.
"And it is incumbent upon us the leadership of the two countries, the governments to find ways to bring peace and stability to each home, each family, in both countries."
The leaders said they also discussed trade and other bilateral issues. Karzai was due to return to Afghanistan on Thursday.
It was their first meeting since August, when they attended a tribal assembly to address the threat of Taliban and Al-Qaeda militants.
The Afghan president is also due to meet Pakistan's caretaker prime minister Mohammedmian Soomro, who holds office until the country's parliamentary elections on January 8 a vote Islamic militants have threatened to disrupt.
Afghan officials have repeatedly said that Taliban militants are being trained and armed in Pakistan and sent across the border to attack Afghan security forces and 60,000 international troops working with them.
They have accused Pakistan of not doing enough against these extremist militants, who are thwarting Afghanistan's internationally backed efforts to rebuild from decades of war.
On Karzai's last visit, he handed over a list of Taliban fighters his government said were sheltering in Pakistan -- which in turn said that the information was outdated.
Pakistan, which has deployed around 90,000 troops on the border, says Afghan and international troops must enhance deployment on the 2,500-kilometre (1,600-mile) frontier to stop the cross-border movement of militants.