Updated

Pakistan's Prime Minister Nawaz Sharif on Saturday pledged his support to the Afghan president in his attempt to bring the Taliban to the negotiating table, a sign of warming ties between the two neighbors.

Sharif met with visiting Afghan President Ashraf Ghani at his sprawling office in the capital, Islamabad. Ghani arrived in Pakistan on Friday for a two-day visit, seeking to repair a relationship between the two nations that was often tense in recent years. Ghani's predecessor, Hamid Karzai, frequently accused Pakistan of turning a blind eye to the Taliban and other militants carrying out cross-border attacks from lawless tribal regions. Pakistan in turn blamed Kabul for failing to police its own borders.

Several weeks ago, Ghani invited the Taliban to join national reconciliation negotiations. On Saturday, Sharif backed Ghani's initiative, 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.

The new Afghan leader praised his Pakistani counterpart and called for the two nations to turn a new page in their relationship. "We must overcome the past," Ghani said. "We will not permit the past to destroy the future."

Ghani expressed hope that Pakistan and Afghanistan would "serve as the heart of Asia to ensure that economic integration in Asia becomes a reality."

He also called for a joint effort to curb extremism and terrorism in both countries, saying "any instability in Pakistan affects us and any instability in Afghanistan affects you."