David Cameron’s meeting yesterday with the Iranian President, Hassan Rouhani — the first such since the 1979 Iranian Revolution — is very welcome. If it presages a recognition that common interests between the United Kingdom and Iran on regional security, bilateral relations and the nuclear dossier should override historic difficulties, its consequences will be very significant indeed. The stakes are high. A failure to agree to a deal with Iran in the long-running nuclear negotiations, due to conclude in eight weeks’ time, risks being one of the foreign policy blunders of the decade.

Rouhani was at the helm of Iran’s negotiations with the West 10 years ago, as national security chief to the then president Mohammad Khatami. A deal was close. It failed when hard-liners in the George W. Bush administration refused any concessions over issues such as spare parts for Iran’s ageing civil airline fleet. With the moderates in Iran discredited, the conservatives saw their chance. The eight dismal years of Mahmoud Ahmadinejad were the result. When Khatami left office in mid-2005, Iran had 200 centrifuges — the machines essential for the production of enriched uranium (used at low strength in nuclear power plants, at high strength in weapon systems). By the time Rouhani gained office last year, and resumed negotiations, Iran had 19,000 centrifuges. This expansion of Iran’s nuclear capability took place alongside dire warnings from the Israeli government that Iran was within months of making a nuclear weapons system.

The warnings were coupled with threats of military action. Such threats were never sensible. Now they are unthinkable. Even a year ago, Iran was seen in much of the Arab world, as well as in Israel and the US, as profoundly hostile to their interests. Today, faced with the common threat from Daesh (Islamic State of Iraq and the Levant), the dynamics of the Middle East are changing. Old enmities are being put aside; new, if informal, alliances are being formed. This week, alongside Cameron’s bilateral, Iran and Kuwait have opened political discussions — and a key meeting of Saudi and Iranian foreign ministers was held last Sunday. I hope the British prime minister has the foresight to recognise that the Iranians are fundamental to securing stability in Syria, northern Iraq and the Lebanon. As some Conservative MPs have urged, a new contact group should be established, with Iran a key member.

Meanwhile, Israel’s influence in Europe has plummeted, with far fewer willing to excuse Benjamin Netanyahu’s disproportionate use of force in Gaza, and his illegal annexation of Palestinian land. Thus, fortune has provided Rouhani with better cards to play than he could have dreamt on his election 13 months ago. But he does not have a free hand. Iran’s governmental system ticks few boxes in a list of western democratic norms. None the less, there is a large political space within which the Iranian president has to negotiate — with the parliament, with the powerful clerical judiciary, and with the Revolutionary Guards (and their business associates).

The appetite of ordinary Iranians for normality with the West has been whetted by the relative domestic progress that Rouhani’s government has made, with the economy stabilising, the currency up and inflation down. Opinion poll suggests that the Iranian people do want a deal on the nuclear dossier, but not at any price.

Crucially, no Iranian leader could sign away Iran’s international treaty rights to civil nuclear power and survive. In my view, allowing Iran to maintain a significant proportion of its existing centrifuges, under international supervision, is essential. So Cameron, and his colleagues in the “P5 +1” (US, Britain, France, Russia, China and Germany) have to be careful not to make the best the enemy of the good. If they push too far, they will end with no deal at all. If that happens, the US’s key partners will start to peel away, led by China, and by Russia. Europe’s major trading partners with Iran — Germany, Italy, and France — are already positioned to expand trade, with German engineering firms anxious to find alternative markets for the sales to Russia that they have lost through Ukrainian-related sanctions.

Even the US has not allowed its tough stance on sanctions to get in the way of expanding its trade in those areas, such as agriculture and pharmaceuticals, which are permitted. This is in sharp contrast to the UK, which has hurt its own interests by unilaterally adopting a policy of not supporting any trade with Iran. Last year, German exports to Iran were 20 times higher than Britain’s, Italy’s 10 times. If Britain wants to see its influence with Iran at least equal to that of major EU states, it needs to make rapid progress in fully re-establishing the British embassy in Tehran and the Iranian embassy in London. Both were closed three years ago when gangs, almost certainly organised by elements of the Ahmadinejad regime, invaded the British embassy compounds and intimidated the staff.

That, as the Rouhani government has accepted, was outrageous. But it is no reason for UK to now drag its feet. The embassies were due to open in May, then August but each date has come and gone. The government, bluntly, needs to get on with it now. There are very few “easy” major foreign policy decisions, still fewer where there is no risk involved. In this case, however, there is a clear balance in favour of the course of action I outline. Over to you, Mr Cameron.

— The Telegraph Group Limited, London, 2014

Jack Straw was Britain’s foreign secretary from 2001-2006.