Judith D'Souza, 40, was working for the Aga Khan Foundation when she was abducted at gunpoint near her home in the Afghan capital, Kabul, on 9 June.
No details have been given about the rescue operation and officials have not said who the hostage takers were.
"Judith D'Souza is with us - safe and in good spirits," Indian Foreign Minister Sushma Swaraj said on Twitter.
Ms D'Souza is travelling back to India with her country's ambassador to Afghanistan and is due to reach Delhi on Saturday evening, Ms Swaraj added.
Jerome D'Souza, a family member, tweeted that the "family's joy knows no bounds".
Kidnapping is a significant problem in Afghanistan. Most of those abducted have been Afghans but foreign aid workers have increasingly become targets.
After Ms D'Souza's abduction, police in Kabul told foreigners living outside secure compounds to travel with guards.
The aid worker was the latest of several Indians to be taken. In June 2014, Father Alexis Prem Kumar, a Roman Catholic priest from India, was kidnapped by unidentified gunmen in the city of Herat. He was freed in February 2015, but details of his release were not disclosed.
At least four Indians have been released from captivity in the past 13 years in Afghanistan. They include two construction workers who were kidnapped and released in December 2003.