The new partnership was termed as political and strategical rather than only economical by the respective heads of the 3 states.
The Indian leader met Iranian officials including supreme leader Ayatollah Ali Khamenei and President Hassan Rouhani during a visit that he said would mark "a new chapter in our strategic partnership".
Modi's visit, the first by an Indian premier to Iran in 15 years, comes after international sanctions against Tehran were lifted in mid-January following an agreement with world powers over its nuclear programme.
Chinese President Xi Jinping visited Iran only days after the sanctions were lifted and pledged to expand trade to $600 billion in the next 10 years.
Xi's visit was in line with his signature foreign policy initiative
known as "One Belt One Road".
The first train to connect China and Iran arrived in Tehran in February loaded with Chinese goods, reviving the ancient trade route known as the Silk Road.
"We want to link to the world, but connectivity among ourselves is also a priority," he said.
"The corridor would spur unhindered flow of commerce throughout the region. Inflow of capital and technology could lead to new industrial infrastructure in Chabahar."
The port, "when linked with the International North South Transport Corridor, would touch South Asia at one end and Europe at another."
Rouhani said it was "not merely an economic document but a political and regional one" with a message of regional opportunities for development.
He cautioned the agreement was not against any other country, but to the benefit of "peace and stability in the region".
"Other countries too can join this document of partnership in future."
India is reportedly seeking to double its imports of oil from the Islamic republic.
Tehran was New Delhi's second largest oil supplier until 2011-12, when the sanctions cut its dependence on Iranian oil.
In the evening, Khamenei received Modi.
"As you mentioned, in addition to oil and gas, Chabahar, one of the major east-west and south-north connecting points can be a platform for deep, long-term and beneficial cooperations," he told Modi.
The Afghan president praised his counterparts and said the Chabahar partnership was only the beginning.
"I thank them because they believe that Afghanistan is going to be stable and they are wagering on our stability," said Ghani.
He also met Iran 's supreme leader at the end of his brief visit.
"Iran will never withhold any technical, engineering or infrastructural help from Afghanistan to harvest its natural resources," Khamenei told him.