The remarkable thaw in Iran’s relations with the United States has, understandably, received much attention. Now, the EU is well-positioned to push the boundaries of the nascent rapprochement with Tehran. In the short term, a nuclear deal is clearly the priority, and progress in talks in Geneva this week is encouraging. But, eventually, it will be highly desirable to see this engagement gradually move beyond government-to-government talks on the nuclear issue.

Significantly, the EU has been here before. And this new phase of relations with Iran will require the EU to draw lessons from its last period of cooperation with the Islamic Republic.

For a period of five to six years after the election of Mohammad Khatami as Iranian president in 1997, the EU moved skillfully to broaden its partnership with Iran across a broad spectrum of policy issues. High-level visits to and from Iran multiplied. “Critical dialogue” morphed into “comprehensive dialogue.” The EU and Iran set up working groups on trade and investment, and unblocked cooperation on energy. In 2002, they launched negotiations for a trade and cooperation agreement. The EU pushed back in united and assertive fashion against U.S. attempts to impose illegal extraterritorial sanctions on businesses trying to operate in Iran.

Security and counterterrorism dialogue started after 9/11, as did a formal EU-Iran human rights dialogue. A number of EU member states ran their own bilateral human rights dialogues; Denmark’s was particularly notable. Several carried out rule-of-law initiatives, in particular Germany and the UK. The French government funded civic initiatives on tolerance. The European Instrument for Democracy and Human Rights launched new projects in Iran, especially on media freedoms.

Yet, of course, after Mahmoud Ahmadinejad was elected president in 2005, all these areas of partnership dwindled.

There will be a long way to go to return to the depth and breadth of engagement that the EU previously enjoyed with and in Iran. Significantly, diplomats acknowledge that Iran was kept outside the EU’s response to the Arab Spring, and little effort was made after 2011 to build up links at the level of civil society. If the EU is to broaden its engagement to include a multiplicity of actors—and not focus solely on a more flexible team of Iranian nuclear negotiators—then it will now be starting from a very low base in this endeavor.

Skeptics say it is essential not to “give” Iran too much, too quickly. The better lesson to draw from the pre-2005 period is more subtle, however.

The EU should beware of investing too much hope in the singular figure of one ostensibly reformist president. European engagement under Khatami stalled, not only because the country’s conservative forces pushed back, but also because the EU lost credibility with the broader spectrum of Iranian reformers. Despite the range of thematic engagement, reformers saw the EU as placing all its eggs in the basket of a president who ultimately was extremely cautious in his reformist moves. The EU refrained from supporting more ambitious reformers and students as they mobilized against Khatami.

The lesson is that future relations will depend not only on President Hassan Rouhani but on reinforcing the linkages between social and economic actors. That is especially important as the regime-loyal president will likely soon disappoint those in Iran hoping that he will advance with far-reaching political reforms. This in no way implies aiming for confrontational and overambitious regime change, but preparing the ground with a range of partners to improve economic and social conditions, as well as governance standards within the current system.

The West must also pay more attention to the regional context within which rapprochement takes place. The EU can complement the U.S.-Iranian reconciliation by working to make sure that more transparent dialogue at a regional level tempers the palpable anxieties felt by other powers, especially in the Gulf.

Rouhani was one of the “pragmatists” who was unable to deliver on the promises that Iran signed with the EU in the early 2000s, in part because of the way that the country’s domestic politics tilted in that period. He should be acutely conscious that the nuclear issue cannot be neatly ring-fenced. European governments must take on board the same lesson.

Observers often claim that in Iran, unlike in other Middle Eastern states, Western interests and human rights values clearly align. This is too simplistic: internal political change would not necessarily produce outcomes entirely comfortable for the West. But it is true that the trade-offs between strategic interest and support for more open governance are not quite as direct as they seem in places like Egypt or Saudi Arabia. Certainly, if nuclear talks do not bear tangible fruit, the West will need other avenues in order to avoid missing this opportunity for engagement.

The EU’s obvious role is to position itself as facilitator of U.S.-Iran contacts. While this is undoubtedly crucial, the EU should also, and more ambitiously, seek to return to the trajectory on which it had started with Iran before the Ahmadinejad interregnum. But the EU should pursue such engagement in a way that is likely to be more sustainable and legitimate over the long term.