The United States said on Thursday that it supported continued Indian involvement in Afghanistan, even as President Donald Trump looks to withdraw troops.

India is one of the most enthusiastic backers of Afghanistan's government, contributing more than $3 billion since the 2001 US-led invasion toppled the Taliban, who harboured virulently anti-Indian militants.

“The United States welcomes India's substantial investment in and assistance to Afghanistan,” said Nancy Izzo Jackson, a State Department official in charge of Afghanistan.

“And we will continue to support efforts to achieve an honourable and enduring outcome in Afghanistan that preserves our investment in Afghanistan's future,” she told a conference on India's role in Afghanistan at the Hudson Institute.

India constructed Afghanistan's new parliament building and has also wooed Afghans with its soft power, including Bollywood films.

But India's involvement in Afghanistan has been a cause of consternation for Pakistan.

The US earlier this year reached a deal with the Taliban to pull troops from Afghanistan and wind down America's longest war.

But Trump said in September that he was withdrawing an invitation to the insurgents to meet near Washington due to the killing of a US soldier.

The US-Taliban talks were facilitated by Pakistan, and Prime Minister Imran Khan had earlier this year regretted that the peace deal that was about to be signed had collapsed.

On Thursday, President Trump in a telephone conversation had thanked Prime Minister Imran for Pakistan’s efforts in facilitating the release of two Western hostages by the Taliban in Afghanistan.

Harsh Vardhan Shringla, the Indian ambassador in Washington, said that any settlement in Afghanistan needed to ensure that “there is no room for any terrorist elements to create a foothold”.

“It is also important to deliver the message to terrorists that democracies do not surrender to terrorism and in the ideological battle of the 'emirate' versus the 'republic,' the latter prevails,” he said.