Image copyright Getty Images Image caption Relations between the US and Iran have an outsized impact on the global trade in pistachios

There are lots of casualties in international conflicts but this one is nuts, you might say - although strictly speaking the pistachio is a seed.

The international pistachio trade has faced unexpected headwinds due to the tensions between Iran and the US.

The global pistachio industry is a multi-billion dollar a year sector that is continuing to grow in value as its popularity as a foodstuff grows.

The US and Iran dominate the world's trade in pistachios - collectively controlling between 70% and 80% of yearly output for the last decade.

Over the last forty years, Iran's growers have faced pressures from sanctions, tariffs and restrictions on their ability to access international financial tools.

Although pistachios themselves were not on the list of sanctioned products, restrictions on global banking made trade difficult for Iranian farmers.

All that changed in 2016 following the Iran nuclear deal, officially The Joint Comprehensive Plan of Action (JCPOA). This agreement with the US and its allies removed sanctions.

It wasn't just Iranian oil that came flowing back onto the international market, pistachio exports began gaining overseas markets.

Trump's threat

That progress could face challenges though. US President Donald Trump called the agreement created under his predecessor the "worst" deal the US has ever made.

In October he decertified the agreement. The move passes responsibility to the US Congress to evaluate and determine whether it believes Iran is compliant with the terms and if the US should remain in the deal.

Image copyright Getty Images Image caption Over 90% of US pistachios are grown in California

President Trump said in the speech announcing his decision that the agreement "threw Iran's dictatorship a political and economic lifeline," but had failed to prevent Iran's "sprint" towards nuclear weapon development.

For Iran's pistachio industry the threat of losing the deal and reinstating sanctions could mean the return of what Hojat Hassani Sadi, deputy director of the Iran Pistachio Association calls "unfair and unequal competition".

Ancient roots

The pistachio industry in Iran dates back thousands of years. By contrast, pistachio farming in the US started in the 1930s with Persian seeds.

The boom in commercial pistachio cultivation came after the US severed ties with Iran following the 1979 hostage crisis, after which the US and its allies placed sanctions on Iran.

Over the next several decades, even in countries where Iranian pistachios were welcomed, restrictions on its companies' ability to access international financing made it hard for the industry to flourish.

Image copyright Getty Images Image caption Archaeological evidence suggests pistachios were first grown in what is now Iraq in 7,000BC

During that time the US market expanded, with farmers - mainly across California - planting the crop.

But in 2014. hot and dry weather conditions across the western US cost the industry nearly half its crop and cut profits for 2015 - the year those nuts were sold - by close to $1.4bn (£1bn).

Globally, pistachio prices rose, but for Iran's growers it was also an opportunity.

Price competition

The price of pistachios has been on the rise since 2002. Richard Matoian, executive director of the American Pistachio Growers (APG) trade association, attributes this to increased awareness of their health properties and global demand for healthy snacks.

"The industry has been pushing the products with advertising," he says, adding that middle-class demand in developing markets has also boosted exports.

Global Trade

More from the BBC's series taking an international perspective on trade:

Increased demand in China has been key to sector growth. Between 2008 and 2013 Chinese imports of US pistachios rose 146% according to APG.

But the 2014 drought saw the price of California's nuts rocket from $3/lb (453g) to over $5/lb.

By contrast Iran's pistachio yield that year was strong. In markets like China, they were able to undercut American prices by close to $0.20/lb.

Image copyright Getty Images Image caption Pistachio plants grow best in arid climates but that leave crops vulnerable to water shortages

A strong growing year in 2016 has helped the US market recover and led to a moderation in price.

But Iran has another advantage that helps it in global trade - its location.

"Iran has a transportation advantage. They can certainly take markets away and China is an example of that," says Mr Matoian.

Uphill march

The advantages and disadvantages for Iran are not only linked to sanctions. Iran claims its pistachios have a better taste, as do several large European distributors, though the US and Iran mainly grow the same strain. (Turkish pistachios, for example, are a different variety.)

The US also imposes a 241% tariff on Iranian pistachios meaning even without sanctions the US market has been all but cut off for Iran.

Image copyright Getty Images Image caption Aging water infrastructure in Iran is a major difficultly for Iran's farmers

Water shortages are another problem for Iran. According to Mr Sadi it is the "major obstacle to growth" for his industry.

Iran's pistachio sector is second in the world following the strong 2016 season in the US. And with the two countries dominating so much of the global market, Iran isn't in dire need of a comeback.

But for the growing number of pistachio fans around the world increased access to Iran's pistachio exports and decreasing prices would be a sweet outcome.