The final result in Iran’s election was more clear-cut than President Hassan Rouhani’s supporters had dared to hope: the incumbent received 23.5 million votes (around 57 percent of the 41+ million votes cast), enough to secure outright victory in the first round. His win allows him to continue the policy of rapprochement that he has pursued since assuming office in 2013, with the 2015 nuclear agreement his biggest success to date. Given the uncertainty emanating from the new US administration, the European Union now has a key part to play. By taking a determined approach on foreign policy, the EU could unshackle itself from the US on a matter of global political importance.

The short but intense election campaign in Iran has shown that lively political debate is possible in the Islamic republic, despite tight controls on the media. Conservatives and moderates went on the offensive, with the former accusing the government of incompetence while the latter denounced the hardliners for wanting to bring back the bad old days of deprivation and no freedom. The Guardian Council, controlled by Supreme Leader Ali Khamenei, only permitted six (male) candidates to stand out of over 1,600 applicants (including both men and women).

In an emphatic endorsement of the moderate course he has taken, President Rouhani received almost five million more votes than in the 2013 election

Both sides withdrew one of their candidates shortly before voters went to the polls, meaning that from the first round the election was a contest between two clerics: the incumbent Rouhani and his opponent Ebrahim Raisi, the arch-conservative grand imam of the Imam Reza shrine in Mashhad (Iran’s second-largest city and an important religious centre). The former attorney general, who was virtually unknown a year ago, is regarded as a confidant of Khamenei and possible successor.

With a high turnout of 73 percent, the result is also a victory for the system. In an emphatic endorsement of the moderate course he has taken, President Rouhani received almost five million more votes than in the 2013 election; however, in his second term he will still be able to act only within the limits laid down by the Supreme Leader and the unelected institutions that support him.

For Europe and the international community, the result represents continuity in terms of foreign policy, as the election was a de facto referendum on whether Iran would stick to its nuclear deal (Joint Comprehensive Plan of Action, JCPOA). This was reflected in the words of the EU’s High Representative of the Union for Foreign Affairs and Security Policy, Federica Mogherini, who took to Twitter shortly after the result was officially announced to congratulate Rouhani on his "strong mandate". She summarised Europe’s priorities in under 160 characters: "#EU ready to continue work for full JCPOA implementation, bilat engagement, regional peace, and meet expectations of all people in #Iran"

Since Washington is unlikely to make concessions on sanctions, the EU must take the initiative

She was addressing the main criticism levelled by the president’s opponents, who claim his deal has not brought a promised economic recovery. Although the Iranian economy has grown by almost five percent in the past year and Rouhani’s government has managed to bring down inflation from over 40 percent to less than 10, the upswing has not been felt by ordinary Iranians.

Since Washington is unlikely to make concessions on sanctions, the EU must take the initiative, for example by providing financing and payment channels or exercising due diligence to verify that Iranian business partners are not affected by existing sanctions.

Mogherini’s second point – greater engagement between Europe and Iran – is in line with the principle of broad-based, bilateral cooperation with third-party states that is at the heart of European foreign policy. It represents a determination to move beyond a narrow focus on the nuclear question, which dominated the 12 years of negotiations that led up to the signing of the JCPOA.

On both these points, there are frictions with Washington. Both the Trump administration and Congress believe trade with Iran is tantamount to strengthening the Iranian regime. The US is therefore willing to cooperate further with Iran on a very limited set of issues, such as in the fight against so-called "Islamic State" (IS) in Iraq. Members of Congress from either party want to force Iran to its knees with new sanctions over its missile programme and its activities in Syria and Yemen.

Expanding bilateral relations in the face of US resistance will demand courage and farsightedness from the EU.

This is the issue addressed by the third and most ambitious point in Mogherini’s tweet: bringing peace to the region. Israel and the neighbouring Persian Gulf states see Teheran’s support for Shiite militias in Lebanon, Syria, Iraq and Yemen as a threat. They believe the problem with the JCPOA lies not in temporary restrictions on the Iranian nuclear programme (indeed, they support this restriction) but in the elevation of Teheran’s status in the region’s politics following successful negotiations with the Obama administration. From the Arab and Israeli perspective, Donald Trump’s visits to Riyadh and Jerusalem (the first calling points on his maiden foreign tour) represented an important, and not merely symbolic, return to old lines of conflict.

This marks a formidable foreign policy challenge for the EU and its member states. Although Rouhani’s re-election means rapprochement between Europe and Iran will continue (provided Iran continues to uphold its JCPOA obligations), tensions with the US are likely to increase. Although the US itself is unlikely to pull out of the actual agreement, it is deliberately endangering the deal with its provocative rhetoric and harsh anti-nuclear measures. The Iranian institutions surrounding the Supreme Leader are likewise opposed to the deal, making an uncontrolled escalation likely.

Expanding bilateral relations in the face of US resistance will demand courage and farsightedness from the EU. Europe demonstrated both these qualities when it began nuclear talks with Iran in 2003. If the EU and its member states build on their diplomatic successes, they could make crucial progress towards another goal: unshackling themselves from the USA on a key security policy issue and showing themselves capable of acting autonomously on the global political stage.