The ruling Bharatiya Janata Party (BJP) and opposition parties condemned US President Donald Trump's comments this week mocking India's role in war-torn Afghanistan.
The United States and India have drawn closer in recent years as they seek ways to counter-balance China's spreading influence across Asia.
But Trump's apparent bid to undermine India's developmental work in Afghanistan has annoyed not just politicians but many citizens too.
President Trump on Wednesday said on he got along very well with Prime Minister Narenda Modi but that he was "constantly telling me he built a library in Afghanistan".
"You know what that is? That's like five hours of what we spend," Trump told reporters at the White House. "And we are supposed to say, 'oh, thank you for the library'. I don't know who is using it in Afghanistan."
It was not immediately clear which library Trump was referring to, but both PM Modi's BJP and the main opposition Congress were united in their criticism of the US president.
India has centuries-old ties with Afghanistan and both accuse common neighbour Pakistan of not doing enough to stop terrorists operating on their territory. Pakistan denies the charges.
"Maybe Trump should know that while he is decrying every other help in Afghanistan, India has been building not only libraries, but roads, dams, schools and even parliament building," Ram Madhav, BJP general secretary, said on Twitter.
"We are building lives, for which the Afghan people thank us, no matter what others do or don't."
The Congress said India did not "need sermons from the US on Afghanistan."
The United States has 14,000 troops in Afghanistan, with reports it might be set to withdraw more than 5,000, a sign Trump's patience is thinning with America's longest war. Trump has already decided to pull all US troops out of Syria.
PM Modi's office did not respond to an email seeking comment and Reuters could not reach the White House outside regular business hours in the US.
India is the biggest South Asian donor to Afghanistan, spending around $2 billion on reconstruction and rehabilitation, according to the Indian embassy in Kabul. Over the past few years India has helped Afghanistan build roads, erect power transmission lines and construct a parliament building.
Afghanistan has not yet responded to Trump's comments.
Afghanistan's national security advisor, Hamdullah Mohib, is expected to meet his counterpart Ajit Doval and other officials in New Delhi today.
"Trump mocked India, a key US non-NATO partner that's done major development work in Afghanistan, for building a library there," Michael Kugelman, South Asia senior associate at the Washington-based Wilson Center think-tank, said on Twitter. "Sigh."
Behind Afghanistan's Rise In World Cricket, BCCI, India's 'Hidden Role' After Afghanistan, BCCI Likely To Help Nepal Get Game Exposure And Training In India In-Form Yashasvi Jaiswal, Shivam Dube Set For Bumper Reward From BCCI: Report Barack Obama Wants Joe Biden To Pull Out Of US Presidential Race: Report World's Largest Isolated Tribe Makes Rare Appearance In New Footage 32 Dead In Bangladesh Unrest, Protesters Set Fire To State TV Headquarters Comedy Legend Bob Newhart Dead At 94: Publicist Israeli Strike Kills Field Commander In Elite Hezbollah Unit: Report Delhi-San Francisco Air India Flight Diverted To Russia After Engine Glitch Track Latest News Live on NDTV.com and get news updates from India and around the world.