BEIJING (Reuters) - The United States must value Pakistan’s role in Afghanistan and respect its security concerns, China’s top diplomat Yang Jiechi told U.S. Secretary of State Rex Tillerson in a phone call, according to Chinese state media.

Secretary of State Rex Tillerson greets Chinese State Councilor Yang Jiechi at the State Department in Washington, U.S., February 28, 2017. REUTERS/Aaron P. Bernstein

China’s Foreign Ministry defended its ally Pakistan earlier this week after President Donald Trump said the United States could no longer be silent about militants using safe havens on Pakistani soil.

On Monday, Trump committed the United States to an open-ended conflict in Afghanistan, signaling he would send more troops to America’s longest war and vowing “a fight to win”.

He insisted that others - the Afghan government, Pakistan, India and NATO allies - step up their own commitment to resolving the 16-year conflict, but he saved his sharpest words for Pakistan.

Yang, who outranks China’s foreign minister, told Tillerson on Wednesday that China was willing to coordinate with the United States on Afghanistan and make joint efforts to realize peace and stability there and in the region, according to a Chinese statement issued late that night.

“We must value Pakistan’s important role on the Afghanistan issue, and respect Pakistan’s sovereignty and reasonable security concerns,” Yang told Tillerson.

Pakistan has been battling home-grown Islamists for years. It sees Afghanistan as a vital strategic interest and a bulwark against old rival, India. Islamabad denies harboring militants, who move across the porous border with Afghanistan.

China and Pakistan consider each other “all-weather friends” and have close diplomatic, economic and security ties.

Beijing has its own security concerns in the region, in particular any links between militants in Pakistan and Afghanistan and Islamist groups China blames for violence in its far western region of Xinjiang.

Foreign Minister Wang Yi met Pakistani Foreign Secretary Tehmina Janjua in Beijing on Tuesday, according to a statement on Thursday. He praised Pakistan’s efforts to combat extremism and to secure the China-Pakistan Economic Corridor, a development initiative central to President Xi Jinping’s global Belt and Road development plan.

“Given the current complicated and changing international and regional situation, the strategic significance of China-Pakistan relations is even more prominent,” Wang said.