On the second day of Indian Prime Minister Narendra Modi’s visit to Iran, the two countries signed a dozen agreements, one of them a tripartite transit and transport deal involving Afghanistan. The deals, signed Monday, include infrastructure projects, energy partnerships, bilateral trade, cultural exchange and intelligence sharing, with a focus on terrorism.

The most talked about contract was for the development of the Chabahar port in the Gulf of Oman on Iran’s southeastern coast. India will invest $500 million in the first phase of the project, which include two terminals and five multi-cargo berths, to be developed by India Ports Global Private Ltd. in partnership with Iran’s Ports and Maritime Organization.

While development of the port will be of obvious benefit to Iran, it also has both economic and strategic importance for India. As a big buyer of energy supplies from Iran, the new port will likely reduce Indian transportation costs for crude oil from Iran to India. Additionally, existing road networks in Iran will also give India access to Afghanistan. Currently, India needs to go through Pakistan to reach the landlocked nation, and Pakistan does not allow India to use its territory to send goods to Afghanistan.

The Chabahar port deal is also being seen as a countermeasure by India to the growing influence of China in the region. Gwadar port in Pakistan is being developed with Chinese investment.

A report in the Persian-language Iran newspaper said, according to the BBC, “India wants to challenge China’s power in Central and South Asia through Chabahar port,” and added that India was “now positioned against its strong competitor by investing in the [Chabahar] port” to resist the Chinese attempts at controlling “the pulse of regional trade by making extensive investments in the Pakistani port of Gwadar.”

Complimenting the port development deal, a tripartite transit and transport agreement was signed between Afghanistan, India and Iran. Iranian President Hassan Rouhani said Chabahar port would benefit India greatly by allowing it access to Central Asia.

“With joint investment and activity in Chabahar, we can connect India via a secure route to Afghanistan and the Central Asian and Caucasus states,” he said.

Rouhani also said other countries could join the agreement in the future, adding: “Today’s document and agreement will not be against any country and the work among the three countries will be beneficial to the entire region, particularly regional peace and stability.”

ChabaharPort A partial view of the Kalantari port in city of Chabahar, Iran, May 12, 2015. Chabahar, located on Iran's southeast coast, is open to the Oman Sea and the Indian Ocean. It is Iran's gateway to Pakistan and Afghanistan in the east, the Central Asian countries to the north, and Turkey and the Gulf countries in the west. Photo: Getty Images/AFP/ATTA KENARE

India will also help build a 500-kilometer (310 miles) railway line between Chabahar and Zahedan near Iran’s eastern border with Pakistan and Afghanistan.

The two countries, which have had close ties historically, also decided to share intelligence and increase the interaction between their security agencies, to combat terrorism and improve regional and maritime security.

“India and Iran share a crucial stake in peace, stability and prosperity in the region. We also have shared concerns over the spread of forces of instability, radicalism and terror in our region,” Modi said after meeting Rouhani.

India is among the largest buyers of Iranian crude oil and is set to import at least 400,000 barrels a day in the 12 months starting April 1. Additionally, the South Asian country is also hoping to buy natural gas from Iran, which has the world’s second-largest proven reserves. Owing to the international sanctions against Iran, which were lifted in January this year, Indian refiners still owe Iran more than $5.5 billion for crude oil imports made from the Middle Eastern nation.

Modi, the first Indian prime minister to visit Iran in 15 years, also met Iran’s Supreme Leader Ayatollah Ali Khamenei, who said, “Islamic countries must be involved” in the fight against terrorism.