Islamabad, Pakistan (CNN) -- Afghan President Hamid Karzai huddled with officials in neighboring Pakistan and said it is imperative that both countries strengthen cooperation and work together to fight militants plaguing both countries.
Both countries "must work diligently and extremely aggressively and effectively to curb terrorism and radicalism in this region," Karzai said at a news conference in Islamabad on Saturday with Prime Minister Syed Yusuf Raza Gilani.
Gilani said Pakistan is ready to support Afghanistan, locked in a grinding war with militants who have bases and links in Pakistan, and back Kabul's reconciliation process with insurgents.
"It's in the interest of Pakistan for a stable, peaceful, prosperous, independent, sovereign Afghanistan," Gilani said.
Both men were taking part in the first meeting of the Afghanistan-Pakistan Joint Commission for Reconciliation and Peace in Afghanistan on Friday and Saturday.
Afghanistan has been frustrated in the past with its neighbor, believing that Pakistan was not doing enough to stop militant activities. The result has been friction between the countries.
But the meeting and its declaration of a "common vision of shared, development, prosperity and peace" indicates closer ties are evolving between both governments.
A joint statement from that meeting said Pakistan fully backed the effort of the Afghan High Peace Council, a group working to pursue peace with the Taliban and other militants.
"The two sides affirmed their resolve to work closely together for reconciliation and peace."
Both sides agreed to "intensify" intelligence and military cooperation and work together to counter the drug trade, according to the statement.
The leaders said the "qualitative improvement" in relations signaled greater ties in trade, development, education, science and youth exchange programs.
They agreed to fully implement a transit trade agreement, talked about upgrading road and rail infrastructures and welcomed the participation of international entities to help development.
"Both sides reiterated their belief that, given their glorious traditions, cultural and civilizational heritage, the proud people of Afghanistan and Pakistan are amply equipped to overcome all pressing challenges and are determined to seize new opportunities for a brighter future for themselves and for the region as a whole," the statement said.