DUSHANBE, March 26 (Reuters) - Iran and Tajikistan plan to construct a railway line through Afghanistan and to improve energy and water supply links between the three countries, the office of Tajik President Imomali Rakhmon said on Monday.

Rakhmon signed a joint declaration with Iranian President Mahmoud Ahmadinejad and Afghan President Hamid Karzai on improving after talks between the three leaders in the Tajik capital on Sunday, the presidential office said in a statement.

It said the three presidents “reached an understanding on how to cooperate more productively to accelerate construction of a railway from Iran to Tajikistan through Afghanistan”.

The countries also plan to build an “energy line” across the three countries to supply Iranian oil products and gas, as well as to link the electricity grids of the three countries and to supply drinking water from Tajikistan to Iran.

Tajikistan, a mountainous Central Asian state of 7.7 million people, is the poorest of 15 former Soviet republics. It relies on imported fuel, mainly from Russia, and plans to develop a hydroelectric power industry, partly with Iranian investment.

Tajikistan shares historical and cultural ties with Iran, which has the world’s second-largest natural gas reserves after Russia. Both countries border Afghanistan.

“Other countries could also become participants in these projects,” the Tajik presidential office said in the statement. Delegations from the three countries will meet in Teheran in two months to discuss implementation of the projects, it said.

In a separate meeting late on Sunday, the three leaders also met Pakistani President Asif Ali Zardari. The presidents were in Tajikistan for a weekend conference to mark the Persian New Year and a regional Afghan economic conference that began on Monday. (Reporting by Roman Kozhevnikov; Writing by Robin Paxton; Editing by Kim Coghill)