Pakistan's Prime Minister Nawaz Sharif has pledged his support to the Afghan president over his attempt to bring the Taliban to the negotiating table, a sign of warming ties between the two neighbours.
Ashraf Ghani, who arrived in Pakistan on Friday for a two-day visit, invited the Taliban to join Afghan national reconciliation negotiations several weeks ago.
I reaffirmed that a peaceful, stable, united and prosperous Afghanistan is in Pakistan's vital national interest.
Sharif backed Ghani's initiative on Saturday, but added that the process must be fully Afghan-led and Afghan-owned.
"I reaffirmed that a peaceful, stable, united and prosperous Afghanistan is in Pakistan's vital national interest," Sharif said at a joint news conference with Ghani, following their meeting in Islamabad.
Sharif emphasised that Pakistan's foremost priority is building a "peaceful neighbourhood".
"As its fundamental element, I have vision of a strong, comprehensive and enduring partnership between Pakistan and Afghanistan, contributing to the security and prosperity of our two nations, and reinforcing efforts for peace and development in the region," he said.
Ghani called for a joint effort to "curb extremism in both countries," saying "any instability in Pakistan affects us and any instability in Afghanistan affects you".
Ghani's predecessor, Hamid Karzai, frequently accused Pakistan of turning a blind eye to the Taliban and other fighters carrying out cross-border attacks from lawless tribal regions.
Meanwhile, Pakistan has accused Kabul of not doing enough to shut down bases on its soil for fighters attacking Pakistani targets.
In the landmark meeting, the leaders also pledged to begin a new era of economic co-operation, with Ghani saying three days of talks had ended 13 years of testy relations.
In recent weeks, various Pakistani officials, including the army chief and head of intelligence, have all visited Kabul.
Earlier this month, the Pakistani army offered to help train Afghan soldiers and provide equipment for an entire infantry brigade.
After the meetings between Ghani and Sharif, the two country's finance ministers signed a deal aimed at more than doubling trade between the two countries to $5bn by 2017, as well as simplifying customs protocols.
Ghani and Sharif said that collaboration on economic and energy issues would form the basis of better security in the troubled region as US-led NATO combat troops leave Afghanistan after more than a decade of fighting the Taliban.
"What we have agreed on is a shared vision where Pakistan and Afghanistan would serve as the heart of Asia to ensure that economic integration in Asia becomes a reality," Ghani said.
The two sides plan to work together on the CASA-1000 electricity line and the ambitious $7.6bn Turkmenistan-Afghanistan-Pakistani-India (TAPI) gas pipeline.
The 1,800km TAPI project aims to link the gas fields of Central Asia to energy-hungry markets in Pakistan and India, with international giants ExxonMobil, Chevron, Petronas, BP and Total all interested, according to sources.