India has rejected US President Donald Trump's comments mocking Prime Minister Narendra Modi for funding a library in Afghanistan, saying New Delhi has provided $3bn in development assistance to the war-torn country.

The US president on Wednesday took a swipe at what he said were Modi's frequent comments about building the library: "You know what that is? That's like five hours of what we spend.

"And we're supposed to say, 'Oh, thank you for the library.' I don't know who's using it in Afghanistan," Trump said.

A statement provided to AFP news agency by government sources in New Delhi said: "India plays a significant role as a development partner," in Afghanistan, with projects aimed at achieving "a tangible improvement in the lives of its people".

190102162117235

As the "largest donor in the region", New Delhi has helped with infrastructure projects, humanitarian assistance and economic development, the statement said.

The projects include a 218-kilometre road, a dam providing irrigation to farmers and training programmes for more than 3,500 Afghans in India.

New Delhi has also provided 1.1 million tonnes of wheat to Afghanistan as well as a 400-bed children's hospital built in 1972 and renovated after the fall of the Taliban in 2002.

Trump also said in the cabinet meeting that the former Soviet Union, which invaded Afghanistan in 1979, was "right to be there" because "terrorists were going into Russia" at that time.

The Afghan government on Thursday has demanded an explanation following the comment, Afghanistan's Presidential Palace said.

The palace said in a statement that the request for clarification was lodged through official diplomatic channels.

181210211443443

The statement added that the Afghan government understands that, "there is a difference between remarks and the official policy of a country".

Afghan Foreign Minister Salahuddin Rabbani, the son of a former leader who fought against the invasion, tweeted that the "Soviet occupation was a grave violation of Afghanistan's territorial integrity and national sovereignty."

Trump also said that currently Russia, Pakistan and India should be intervening in Afghanistan, not the US.

"Why are we there 6,000 miles away?" he said. Some 14,000 US troops are currently stationed in Afghanistan.