The release of the 15 British Navy personnel in Tehran is a triumph for diplomacy. Yet to be completely successful it must now be seized as an opportunity to open genuine talks between London and Tehran. Yesterday the delighted smiles and heartfelt relief of relatives of the captured sailors and marines expressed the positive outcome to an alarming and distressing incident which should never have happened. However, a disturbing mirror image was the smiling satisfaction of President Mahmoud Ahmadinejad as he played out the final moves in this unsavoury display of manipulation for the benefit of the cameras and microphones of the international media.

Having used a lengthy and dramatically stage-managed press conference to reiterate his position that the British crew had "trespassed" in Iranian waters and to bestow medals on the Iranian coastguards who had captured the sailors, thus causing hopes to plummet, he announced that he would free the captives. President Ahmadinejad later met the sailors, with their personal thanks to him for having treated them well also clearly recorded. As the sequel to the film of them "confessing" they had strayed into Iranian waters, this amounted to orchestrated propaganda as much as face-saving diplomacy. No-one was in a position to argue and it achieved the desired outcome of having the group released in good condition, but that is hardly the end of the matter.

Welcome as this "Easter present" from Iran is in the UK, it conceals a deep-seated, difficult and dangerous distrust between Britain and Iran which has festered for over half a century, fluctuating between friendship and stand-off as the regimes in Tehran have alternated between modernising and revisionism. The election of Mahmoud Ahmadinejad as president and his revival of the defiantly anti-Western rhetoric of the Islamic Revolution marked a new deterioration, while his determined pursuit of Iran's nuclear programme and provocative denunciation of Israel have caused international alarm. Nevertheless, Iran is a complex country with different power bases. Although the clerics have ultimate power, the moderates are an important force and it is probably significant that the Revolutionary Guard seized the hostages during a holiday period, when many well-educated moderates who work behind the scenes of government, were away.

There are many delicate issues which must be discussed, bilaterally as well as internationally through the UN and other agencies. The detention of five Iranians by American forces in Iraq - without consular access - is one of them. Yesterday Mr Blair's thanks were pointedly directed not to President Ahmadinejad, but to "our friends and allies" in the region, the EU and the UN.

That acknowledges the effect of the statement deploring the incident issued by the EU and the UN Security Council in underlining how isolated Iran was becoming. The intervention of Turkey and Syria, therefore, may have tilted the balance. With the first direct contact between Downing Street and Iran's negotiator taking place only on Tuesday evening, there is some substance to the notion that the president was persuaded that he could use the press conference to achieve his moment of glory.

The "measured approach - firm but calm, not negotiating, but not confronting either," praised by Mr Blair, has worked and should be given credit; but as soon as our sailors are safely home, we must look again into the murky waters of Shatt al-Arab. Control of the waterway between Iraq and Iran has been in dispute since the seventeenth century and was one of the principal causes of the eight-year Iran-Iraq war which erupted in 1980, but we cannot allow any more British military personnel to be manipulated in this way.