Ties between the two countries nosedived after Pakistan and the US supported a Taliban office that opened in Doha in June to foster talks and also over a reported statement by Pakistan's National Security Advisor Sartaj Aziz that Kabul should cede some provinces to Taliban for lasting peace.
Aziz reportedly proposed this to Afghan ambassador Umer Duadzai in a meeting in Islamabad in June.
Confirming the visit at the invitation of Prime Minister Nawaz Sharif, Foreign Office spokesman Aizaz Chaudhry said the Afghan president would be accompanied by a high-level delegation of cabinet ministers and senior officials.
"This will be the first highest-level exchange between Pakistan and Afghanistan since the democratic transition and swearing-in of the new government," said Chaudhry. "Karzai's visit will carry forward this process of constructive engagement between the two countries."
Sharif has set out an agenda of improving ties with all neighbours and he spoke at least thrice to Karazi since taking office in June.
The two leaders will have in-depth consultations on all issues of common interest, including the evolving situation in the region as well as ways to deepen and broaden Pakistan.
Chaudhry said peace and stability in Afghanistan are in Pakistan's vital interest and his country has extended consistent support for the promotion of peace and reconciliation in Afghanistan.
"Pakistan remains committed to working with Afghanistan as well as regional and international partners for sustainable peace and development," he said.
Pak to free 367 Indian prisoners to send positive message
Pakistan for peaceful settlement of issues with India
These 16 nations have been a total failure!
India, Pakistan arms race must come to an end: Sharif
Pakistan bats for PM-Sharif meeting to 'build trust'