Pakistan's intelligence services are willing to work more closely with Afghanistan to fight Taliban militants, Pakistan's president said Wednesday after talks with the Afghan leader focussed on allegations Islamabad is harboring Afghan insurgents. Afghan President Hamid Karzai made a veiled reference to the existence of terrorist hideouts on the Pakistani side of their shared border. He said he and President Asif Ali Zardari had discussed ways to tackle the sanctuaries and training grounds, but did not say whether anything had been agreed. “The reality is that they (the militants) must have a base somewhere,” he said. “Those who are attacking us in Afghanistan and those who are attacking you in Pakistan don't come from, say, the Ivory Coast or Burkina Faso or Brazil or any other place you can imagine,” he said. In recent weeks, Karzai and other Afghan government officials have made increasingly strong statements against Pakistan's alleged support of militants, echoing long-held complaints by American officials. Complicating the issue, Karzai is also believed to be trying to talk with some Taliban factions as a way to end the nine-year conflict, and Pakistan's help in mediating those talks could be crucial. Zardari said at a news conference that the two nations' cooperation had improved since he took office and “we intend to enhance it further.” Karzai and Zardari several times called each other “brothers” and referred to Islamabad as Karzai's “second home.” Washington has been encouraging closer ties between the governments as a way of reducing tension in the region. “We need more security cooperation between our intelligence and their intelligence, which Pakistan is willing to offer,” said Zardari. It was not clear, however, if the offer was endorsed by Pakistan's military and intelligence establishment, which dictates the country's foreign and security policies, especially in regard to Afghanistan and arch enemy India. Many analysts say it wants to keep Afghan insurgents as proxies to secure its interests in Afghanistan when the Americans withdraw. Karzai said the fact the nations were talking about the issue of militants on Pakistani soil was a sign of progress. “This openness in dialogue is a step forward in our relations,” he said. “This trip is for that connection, it has been productive and good.”