The interior ministers of Turkey and Iran on Wednesday signed a memorandum of understanding designed to prevent terrorist and illegal activities the countries face, particularly along their borders.

Iranian Interior Minister Ahmad Vahidi hosted his Turkish counterpart Süleyman Soylu in the capital Tehran on Wednesday.

In a statement following a bilateral meeting, Soylu wished Vahidi all the best in his new office.

“To date, we have had very successful cooperation on various issues,” he said, adding that many problems have been solved.

Hailing the cooperation between the two countries, Soylu said: “We acted like members of a single country in our cooperation at the border, counterterrorism efforts, fight against drug smuggling, and cross-border organized crime. Our collaboration is not diplomatic cooperation, it is a fraternity.”

After the meeting between the delegations, the two sides signed a memorandum of understanding to cooperate in the field of security.

With the aim of increasing and developing the security cooperation between the two countries, the deal was struck to prevent all terrorist and illegal acts the two countries may face, especially in the border regions. It also encompasses the mutual development of a host of law enforcement practices.

Turkey and Iran seek to achieve their shared goal when it comes to operational workforce capability through the understanding that will allow for the rapid sharing of knowledge and experience.

Soylu said that they evaluated the problems faced by the Muslim community and discussed their responsibilities.

Vahidi, who assumed office on Aug. 25, was the defense minister under former Iranian President Mahmoud Ahmadinejad, having held the post from 2009 until 2013.

Faced with a new potential migrant wave due to the instability in Afghanistan, Turkey has maximized measures on its eastern border with Iran. Turkey is continuing efforts to bolster the security of its border with Iran to prevent any migrant influx in the face of the recent developments in Afghanistan. The beefed-up border measures in Turkey, which already hosts nearly 4 million Syrian refugees and is a staging post for many migrants trying to reach Europe, began as the Taliban started advancing in Afghanistan and took over Kabul following the U.S. withdrawal.

Turkey is not the only country putting up barriers. Its neighbor Greece has just completed a 40-kilometer (25-mile) fence and surveillance system to keep out migrants who manage to enter Turkey and try to reach the European Union.

Authorities say there are 182,000 registered Afghan migrants in Turkey and up to an estimated 120,000 unregistered ones. President Recep Tayyip Erdoğan urged European countries to take responsibility for any new influx, warning that Turkey had no intention of becoming “Europe’s migrant storage unit.”

Turkey has been a key transit point for asylum-seekers attempting to cross into Europe to start new lives, especially those fleeing war and persecution. Concerns have risen over a possible spike in migrants from Afghanistan, due to the United States’ pullout from the country and the following surge of Taliban attacks. Turkey has made it clear that it will not bear the burden of the migration crises experienced as a result of the decisions of third countries.