China's top diplomat has defended Pakistan's “important role” in Afghanistan in a phone call with United States Secretary of State Rex Tillerson, after US President Trump accused Islamabad of harbouring militants.

Trump, in unveiling his Afghanistan strategy this week, alleged that Pakistan was playing a double game by accepting American aid while giving safe haven to militants who kill Afghan and Nato troops. Islamabad strongly denied the allegations.

China State Councillor Yang Jiechi told Tillerson on Wednesday that “we should attach importance to the important role that Pakistan plays in the Afghanistan issue, respect (Pakistan's) sovereignty and legitimate security concerns,” according to a foreign ministry statement.

It is the second time Beijing has defended its neighbour this week, with foreign ministry spokeswoman Hua Chunying praising Pakistan on Tuesday for making “great sacrifices and contributions to fighting terrorism”.

Yang said Beijing was committed to “advancing the peace and reconciliation process in Afghanistan” and that political dialogue was “the only way to solve the Afghanistan problem”.

He added that “China would like to continue to maintain communication and coordination on the Afghanistan problem with the US side”.

The call between the US and Chinese diplomats came after new tensions arose between the two powers on Wednesday as Washington slapped sanctions on Chinese companies accused of links with North Korea, angering Beijing.

China has also warned Washington against triggering any “trade war” after Trump ordered an investigation into Beijing's intellectual property practices. But the ministry statement issued late Wednesday did not say whether Tillerson and Yang discussed the trade issue, the sanctions or the North Korean nuclear crisis.

Yang said Washington and Beijing communicate and cooperate on a “wide range of areas” and the two diplomats discussed Trump's planned visit to China later this year. He also voiced hope that the two sides maintain “mutual respect” and "handle disputes properly and jointly to uphold the good momentum of development of Sino-US relations."

Beijing is investing around $50 billion in Pakistan as part of a plan unveiled in 2015 to link its far-western Xinjiang region to the Pakistani port of Gwadar in Balochistan province.