Afghan President Ashraf Ghani and Indian Prime Minister Narendra Modi have inaugurated a multi-million-dollar dam in western Afghanistan that will bring power and irrigation to vast tracts of the war-torn country.

The Afghan-India Friendship Dam in Herat province, which borders Iran, was built with Indian aid at a cost of $300 million and was under construction for about a decade, the latest symbol of Indian investment in its South Asian neighbour.

The dam, originally built in western Herat province in 1976 before being damaged during the civil wars of the 1990s, was rebuilt by some 1,500 Indian and Afghan engineers, according to the Indian Ministry of External Affairs.

"It is symbol of our friendship and would usher in hope, light up homes, nourish the fertile fields of Heart and bring prosperity to the people of the region," Modi said in a social media post as he departed for Afghanistan, the first stop on a five-country trip.

Read: India wants to deny Pakistan strategic depth in Afghanistan: US report

Modi arrived in Afghanistan Saturday for the formal inauguration of the project. At more than 100 metres (330 feet) high and 540 metres (1,770 feet) wide, the dam is designed to generate 42 megawatts of power and help irrigate 75,000 hectares of land, according to Modi.

Ghani hailed the dam as a symbol of bilateral ties with India. Afghanistan has cultivated closer ties with India in recent years as a balance to neighboring Pakistan, which has been accused of supporting the Taliban insurgency.

Afghanistan has walked a fine line as it accepts Indian aid, with Pakistan historically wary of any Indian influence in Afghanistan.

"Salma Dam is another big step in deepening and broadening the relationship between Afghanistan and India," Ghani said in a post on Twitter.

India has poured more than $1 billion into Afghanistan reconstruction projects and humanitarian aid, making it one of the largest donors to the war-torn country.

A new national assembly building in Kabul and major power line and road construction have been among the main projects funded by India.