ISLAMABAD (Reuters) - Pakistan’s Foreign Secretary met China’s special envoy on Afghan affairs on Monday, a foreign office spokesman said, a day after Islamabad canceled a scheduled visit by a top U.S. official.

The decision by Pakistan to postpone the visit of Alice Wells, acting assistant Secretary of State for South and Central Asian Affairs, came a week after President Donald Trump said Islamabad was prolonging the war in Afghanistan.

Trump had accused Pakistan of harboring “agents of chaos” and providing safe havens for militant groups waging an insurgency against the U.S.-backed government in Kabul.

Pakistani officials responded by saying the U.S. should not “scapegoat” Pakistan and accused the American military of failing to eliminate militant sanctuaries inside Afghanistan.

Wells had been due to discuss Trump’s new Afghan policy during her time in Islamabad.

During Monday’s visit, Chinese envoy Deng Xijun and Pakistan’s Foreign Secretary Tehmina Janjua discussed “efforts for lasting peace and stability in Afghanistan,” Pakistan’s foreign office said in a statement.

“The Chinese special envoy lauded Pakistan’s contribution and sacrifices made in the fight against terrorism ... he said Pakistan’s efforts toward eliminating the scourge of terrorism should be fully recognized by the international community,” the foreign office said.

Beijing has pledged to spend $57 billion on infrastructure projects in Pakistan as part of its “Belt and Road” initiative.

China’s spending in Pakistan has helped to revive the country’s sputtering economy.

The deepening ties between the two nations have turned Pakistan into a key cog in China’s plan to build a modern-day “Silk Road” of land and sea trade routes linking Asia with Europe and Africa.