Iranian President Ebrahim Raisi said on Monday that the US military failure in Afghanistan provides an opportunity to achieve lasting peace in the country.

Iranian state television quoted Raisi as saying that ensuring stability in Afghanistan is a priority, stressing that Iran will help achieve this, as a neighbor and friend.

The Iranian president called on all Afghan parties to work towards achieving national reconciliation in Afghanistan.

The presidential statement did not directly mention the Taliban movement or its control over various parts of the country during the past period, up to its entry into Kabul on Sunday.

But he quoted Raisi as confirming that his country carefully monitors developments in Afghanistan, and attaches importance to good-neighborly relations with its neighbor, with which it shares a border of more than 900 km.

The statement indicated that Raisi asked Foreign Minister Mohammad Javad Zarif and Secretary of the Supreme National Security Council Ali Shamkhani to submit periodic reports to him on the developments in Afghanistan.

And the Taliban took control of the country in light of the collapse of government forces and the flight of President Ashraf Ghani, with the completion of the withdrawal of US forces after an existence that lasted 20 years.

Washington accused Iran in the past of providing covert aid to Taliban fighters against US forces, but Iran - which says it supports the existence of an inclusive Afghan government that includes all ethnicities and sects - denied the US accusations and demanded it withdraw from Afghanistan.

For years, Iran has hosted more than 3.46 million Afghans on its soil, according to figures from the United Nations High Commissioner for Refugees.