The prisoner swap by the United States and Iran was a welcome act in a region riven by conflict. Washington and Tehran's patient engagement served notice that diplomacy, undertaken with mutual trust and resolute ambition, can achieve its aims despite attempts at sabotage by political opponents. It took place alongside a larger and more significant nuclear deal.
Under the atomic agreement, Iran held fast to a pledge to spike its nuclear programme for at least 15 years in return for the lifting of United Nations sanctions. As a result, the world is a safer place and Iran a richer country.
The International Atomic Energy Agency confirmed at the weekend Iran had shipped more than 8.5 tonnes of enriched uranium to Russia - fuel that Iran cannot therefore use to make bombs. Concrete has been poured into the core of a reactor designed to produce plutonium and thousands of centrifuges used to enrich uranium have been disabled. Visits by IAEA inspectors will make cheating harder.
These were big steps for a regime suspicious of American and Western motives. Accounts of the high-level talks that preceded the deals included reminders from the Iranian side of past grievances with the US stretching as far back as a 1953 CIA-backed coup as well as American support for Iraq in its war with Iran in the 1980s. But these obstacles in the end did not derail the agreements, given that by defusing its nuclear threat Iran unlocked US$100 billion frozen in overseas banks. These funds will be vital in reviving Iran's domestic economy and should help the Middle East nation resume its place in the global economy. In a sign of the country's intentions, state-owned carrier Iran Air is to buy 114 Airbus jets to upgrade its ageing fleet.
Bringing Iran back from the cold has implications for New Zealand. Thirty years ago, Iran was a key market for New Zealand, taking as much as 60 per cent of lamb exports before trade fell away once sanctions were imposed. With restrictions lifted, exporters should expect demand to rebound.
Dairying, too, should find a growing market among Iran's 80 million consumers. At the same time, Tehran's drive to sharply expand oil exports will keep downward pressure on global fuel prices.
The West's relations with Iran are likely to remain complex. The US slapped fresh sanctions on the regime just as the UN lifted its financial clamps because Tehran had conducted a ballistic missile test. The regime staunchly supports Syrian President Bashar al-Assad, a stance which is at odds with the US and Sunni Arab powers including Saudi Arabia. In Yemen, a US-supported, Saudi-led coalition is fighting to peg back gains by Iranian-backed Shiite rebels. But as a Shia power, Iran is firmly opposed to the Sunni-inspired Islamic State.
The more moderate President Hassan Rouhani called the nuclear deal a "golden page" in Iranian history. US President Barack Obama said it showed what "smart, patient and disciplined" diplomacy could achieve. It is a long time since a positive outcome has emerged from the crises which beset the Middle East.
If Iran is committed to a constructive role, there could yet be more.