According to the ministry, they also called for coordination to address future challenges.
The talks were headed by the deputy chief of armed forces of Iran and Afghanistan.
In the statement, the ministry noted that Afghanistan seeks good relations with Iran and is committed to further cooperation across different sectors.
The Iranian military delegation arrived in Afghanistan on Saturday for two-day talks.
It came days after Iranian President Ebrahim Raisi warned the issue of Iran’s water share from Helmand River was a “serious” issue and warned the Taliban of consequences if the rulers of Afghanistan refuse to release Iran’s share of the water.