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.