The Kingdom of Afghanistan and the Union of India established bilateral relations in January 1950. India was the only South Asian country to recognize the Soviet-backed Democratic Republic of Afghanistan, supporting it in the Soviet–Afghan War (1979–1989) against the Afghan mujahideen. India remained mainly neutral during the 1990s Afghan civil wars, though was opposed to the Taliban government. Following the 9/11 attacks in 2001, India aided overthrow of the Taliban and became the largest regional provider of aid to the Islamic Republic of Afghanistan. A major shift in India's position on the Taliban was reported by a top Qatar official in June 2021, revealing that an Indian delegation quietly visited Doha to meet the Taliban's leadership. This is a major shift that was several weeks in the making in the first half of 2021, and likely involved Qatari mediation between India and the Taliban. Although India does not recognize the Islamic Emirate of Afghanistan, it maintains close informal ties with the ruling Taliban.
In April 2017 Shaida Mohammad Abdali, Afghanistan's former ambassador to India, pointed out that India "is the biggest regional donor to Afghanistan and fifth largest donor globally with over $3 billion in assistance. India has built over 200 public and private schools, sponsors over 1,000 scholarships, and hosts over 16,000 Afghan students." Relations between Afghanistan and India received a major boost in 2011 with the signing of a strategic partnership agreement, Afghanistan's first since the Soviet-Afghan War. The student visas were revoked in large numbers after the Taliban takeover of Afghanistan.