Sadiq Khan said both sides agreed to strengthen coordination and expand joint counterterrorism cooperation to preserve regional peace and stability.
The meeting comes as China continues its efforts to reduce tensions between the Taliban and Pakistan.
It also follows months of escalating tensions between Pakistan and the Taliban, including border clashes, Pakistani air strikes inside Afghanistan and accusations by Islamabad that militant groups are using Afghan territory to launch attacks.
The Taliban has rejected the allegations, saying insecurity and militant activity in Pakistan are internal matters for Islamabad.
Writing on X on Tuesday, Mohammad Sadiq Khan said the two sides held constructive discussions on regional security, including threats posed by Tehreek-e-Taliban Pakistan (TTP) and the East Turkestan Islamic Movement, which he said operate from Afghan territory.
Tehreek-e-Taliban Pakistan, an umbrella organisation of Islamist militant groups, has been responsible for some of the deadliest attacks in Pakistan in recent years.
Islamabad says many members of the group operate from safe havens across the border in Afghanistan, a claim the Afghan Taliban denies.
Pakistan and China have also repeatedly expressed concern about the East Turkestan Islamic Movement.
Beijing accuses the group of seeking to establish an independent state in China’s Xinjiang region.
The talks took place as China has increased its mediating role between Pakistan and Afghanistan. One reason for Beijing’s approach is concern over the impact of instability on regional connectivity projects and Chinese economic interests, including the China-Pakistan Economic Corridor.
Relations between Pakistan and the Taliban deteriorated sharply earlier this year following deadly border clashes, leading to the most serious confrontation between the two sides in recent years.
In February, Pakistan carried out air strikes inside Afghanistan and accused the Taliban of sheltering militants, while the Taliban condemned the attacks and denied supporting armed groups.
Since then, China has intensified diplomatic efforts to prevent the crisis from escalating further.
In March, Yue Xiaoyong conducted diplomatic shuttle visits between Islamabad and Kabul, and Beijing also hosted direct talks between Pakistani and Taliban officials in Urumqi, the capital of Xinjiang.
Chinese officials have publicly urged both sides to resolve their disputes through dialogue rather than military action and have supported efforts aimed at securing a ceasefire and reaching a broader political understanding.
In April, Pakistan and the Taliban also resumed talks under Chinese mediation to reduce tensions and explore a long-term framework for addressing border security, militant activity and economic cooperation.
Both sides later described the discussions as constructive, while China said the negotiation process was making progress.