TEHRAN, Iran (AP) — Iran’s President Hassan Rouhani said Monday that a new joint security force with Pakistan will be formed to combat militants based along the two countries’ shared border.

Both Pakistan and Iran have said militant groups operate from the other country’s soil, occasionally carrying out deadly cross-border attacks.

The agreement comes after Pakistan’s Foreign Ministry said Saturday that a group of militants crossed from Iran earlier in the week and attacked Pakistani armed forces in southwestern Baluchistan province, killing 14.

Rouhani announced “a joint quick-reaction force for fighting against terrorism at the borders” had been agreed to during his meeting with Pakistani Prime Minister Imran Khan a day earlier. Rouhani did not elaborate.

Khan, on a two-day visit to Iran that had been scheduled since before Thursday’s attack, said Pakistan “will not allow any militant groups to operate from our soil.”

Groups operating within Pakistan’s and Iran’s Baluchistan provinces, which share a long border, seek independence from both countries.

Rouhani also said he’ll increase the volume of trade with Pakistan, which amounts to nearly $1.5 billion annually. He said Iran is poised for a ten-fold increase in electricity exports to Pakistan, currently at around 100 megawatts per hour.

He said the two countries were interested in a rail link between the port cities of Gwadar in Pakistan and Chabahar in Iran.