Afghan President Ashraf Ghani, called for regional cooperation to defeat militant groups, after meeting the Indian prime minister.
Ghani, who is in India on a three-day state visit, said that he wants to "make Afghanistan a graveyard of terror" but needs help from India, Pakistan and other neighbours.
Meanwhile, the battle on the outskirts of Kunduz between Afghan forces and Taliban militants, which led President Ghani to delay his departure to India by several hours, reportedly killed scores of combatants.
Having announced their spring offensive last week, the Taliban is reportedly seeking to gain territory in the north, where the Afghan army and police have less presence. Afghan forces sent reinforcements to Kunduz this week after the Taliban penetrated a southern district of the provincial capital, called Kunduz city.
Government forces said they killed a Taliban commander known as Mullah Mustafa, adding that a total of 50 militants had died in the past few days' fighting.
Nine Afghan security forces have been killed in the fighting.
Afghan President's visit to India comes amid his efforts to forge closer ties with neighbours against Taliban.
"Terror cannot be classified into good and bad. It cannot be differentiated," Ghani said.
"We must have a unified approach, we must be united both in the region and globally to contain this terror."
Modi, for his part, pledged continued support for Afghanistan's fight and renewed commitment to developing both land and sea trade routes with the country.
India would continue to help build the Afghan military and recently delivered three Cheetal helicopters,Modi also said, adding India should join an existing Afghan-Pakistan Trade and Transit agreement to allow goods to flow by land from Afghanistan to eastern India and back.
Ghani thanked India for pouring $2.2 billion in aid into his country's development over the past decade and outlined an ambitious vision for his war-ravaged nation to achieve peace and return to its centuries-ago status as a crossroads for regional trade.
Although this is Ghani's first visit to India after he became Afghan President seven months ago, he has already met Modi during the South Asian Association for Regional Cooperation summit in Kathmandu last November.