Neighbors Pakistan and Iran on Wednesday pledged to enhance efforts at a "united front" against Afghanistan-based militants, saying their presence poses a serious threat to regional and global security.

The countries, which share a long and porous border, made the commitment in a joint statement issued after a three-day visit by Iran’s President Ebrahim Raisi to Islamabad.

PAKISTANI, IRANIAN LEADERS SEEK TO INCREASE TRADE, EASE DIPLOMATIC TENSIONS

The visit was aimed at mending ties that were strained in January when each carried out strikes in the other’s territory, targeting militants accused of attacking security forces.

The Iranian president met with Pakistani President Asif Ali Zardari, Prime Minister Shehbaz Sharif and other officials, including powerful army chief Gen. Asim Munir.

Pakistan-Iran

In this photo released by the Press Information Department, Iranian President Ebrahim Raisi, left, shakes hand with Pakistan's Prime Minister Shehbaz Sharif prior to their meeting at prime minister's house in Islamabad, Pakistan, Monday, April 22, 2024. Iranian and Pakistani leaders vowed to strengthen economic and security cooperation in a meeting on Monday, as the two countries seek to smooth over a diplomatic rift.  (Press Information Department via AP)

The joint statement said the two sides "reaffirmed their willingness to enhance cooperation on counter-terrorism and security and to develop a united front against terrorism."

Pakistan has witnessed a surge in militant violence in recent months, mostly blamed on Afghanistan-based Pakistani Taliban and insurgents who also target security forces in Iran.

Pakistan often says Pakistani Taliban have stepped up attacks since 2021 when the Afghan Taliban came to power. The Pakistani Taliban, known as Tehreek-e-Taliban Pakistan, or TTP, is a separate group but allied with the Afghan Taliban.

However, Afghanistan’s Taliban government insists it does not allow the Pakistani Taliban — or any other militant group — to use Afghanistan’s soil to launch attacks against any other country. In March, the Pakistan Air Force targeted multiple suspected hideouts of the Pakistani Taliban inside Afghanistan. The Afghan Taliban said the attacks killed eight people and prompted return fire from their forces.

Tehran has also blamed an Afghanistan-based Islamic State affiliate for recent attacks in Iran. The affiliate is also active in Pakistan's southwestern Baluchistan bordering Iran.

In recent years, Pakistan has urged Tehran to take stern action against Pakistani insurgents living inside Iran near the border. They often target security forces in Baluchistan, the scene of low-level insurgency by separatists for more than two decades.

Pakistan and Iran also agreed that their common border should be the "border of peace and friendship," and reiterated the importance of regular cooperation between political, military and security officials to combat other threats such as narcotics smuggling, human trafficking, hostage-taking and money-laundering.

The countries also agreed to expand trade and economic cooperation, pledging to set up new border markets, new border crossings and economic free trade zones.

CLICK HERE TO GET THE FOX NEWS APP

The two sides also condemned the suspected Israeli strike on April 1 targeting a consular building next to the Iranian Embassy in Syria which killed two Guard generals and others. Iran responded with unprecedented direct strikes on Israel.

Authorities also said Pakistan and Iran also discussed how to go ahead with their gas pipeline project, which has been on hold mainly because of fears of U.S. sanctions. The project — opposed by Washington as a violation of sanctions imposed on Tehran over its nuclear program — launched in 2013 to supply Iranian natural gas to energy-starved Pakistan.