Iran’s Raisi visited Pakistan as the neighbours seek to mend ties after tit-for-tat military strikes this year.

Islamabad, Pakistan â€“ The United States has warned Pakistan of the risk of sanctions after it promised greater security and economic cooperation with Iran during a visit by President Ebrahim Raisi.

The first Iranian president to visit the South Asian country in eight years, Raisi concluded his three-day trip on Wednesday as the neighbouring countries said they would increase bilateral trade to $10bn a year over the next five years, from the current $2bn.

Pakistan’s foreign office said the two sides additionally agreed to cooperate in the energy sector including trade in electricity, power transmission lines and the Iran-Pakistan gas pipeline project.

The gas pipeline project has languished for more than a decade because of political turmoil and international sanctions.

The US Department of State on Tuesday cautioned the Pakistani government of engaging in business deals with Iran.

“We advise anyone considering business deals with Iran to be aware of the potential risk of sanctions. But ultimately, the government of Pakistan can speak to their own foreign policy pursuits,” spokesperson Vedant Patel said during a news briefing.

Foreign policy expert Muhammad Faisal said the United States threats of sanctions are merely meant to dissuade Pakistan and “increase the cost of doing business with Iran”.

“Any expansion of formal trade and banking activity between the two nations will be slow, as Pakistani banks are reluctant to do direct business with Iranian banks,” he told Al Jazeera.

A wide-ranging list of business-related activities with Iran can trigger US sanctions, and the regulations also bar business dealings with Iranian financial institutions.

The pipeline was to stretch more than 1,900km (1,180 miles) from Iran’s South Pars gas field to Pakistan to meet Pakistan’s rising energy needs.

Iran said it has already invested $2bn to construct the pipeline on its side of the border, making it ready to export. However, the project is yet to take off from the Pakistani side due to fears of US sanctions.

Pakistan indicated last month that it will try and seek a waiver from the US to construct the pipeline on its territory.

Washington’s efforts to restrict Iran’s income from oil and petroleum products go back decades. It has additionally sanctioned hundreds of entities and people in Iran – from the central bank to government officials – accused of materially supporting Iran’s Islamic Revolutionary Guard Corps and armed groups such as Palestine’s Hamas, Lebanon’s Hezbollah and Yemen’s Houthis.

The US and the United Kingdom this month imposed a new round of sanctions on Iran after its unprecedented attack on Israel, but the punitive measures were limited in scope and there have been questions over how effective the sanctions regime has been overall.

“Islamabad is cognisant of these constraints and both sides have been exploring ‘out-of-the-box’ solutions for expanding bilateral trade through barter system and border markets with the involvement of local chambers of commerce,” Faisal said.

Pakistan has little leverage

During his visit, Raisi met the country’s top leadership, including Prime Minister Shehbaz Sharif and army chief General Asim Munir.

The visit came as the two countries try to repair their frayed relationship following heightened tensions in January when Iran launched attacks on Pakistani territory on what it said were bases of armed group Jaish al-Adl.

In less than 48 hours, the Pakistani military carried out strikes in Iran on what it said were “hideouts used by terrorist organisations”.

Yet, the implied threat of sanctions comes at a challenging time for Pakistan, which is mired in economic woes and is seeking financial help from its allies, including key partners such as Saudi Arabia, the United Arab Emirates and the US, three countries that are considered rivals of Iran.

Sharif was in Saudi Arabia this month to meet Crown Prince Mohammed bin Salman and is expected to travel to the kingdom again next week.

Kamran Bokhari, a senior director at the Washington, DC-based New Lines Institute for Strategy and Policy, said Pakistan cannot afford to get caught in the middle of a conflict between the US and Iran.

“Those two countries are engaged in their own rivalry and Iran sees itself in ascendancy at the moment due to situation in the Middle East,” Bokhari told Al Jazeera, referring to Israel’s war on Gaza.

“The US wants to contain Iran and the tools it has are sanctions. Now Pakistan needs the US and Western goodwill to help it deal with its economic crisis,” he said, adding that it should “steer clear of any move that risks it”.