By Bridget Kendall
BBC diplomatic correspondent
President Ahmadinejad took everyone by surprise
That moment on Wednesday when President Mahmoud Ahmadinejad waved his magic wand and declared he was freeing the captured British crew looked like a public relations coup of some magnitude.
And no wonder he beamed broadly as they all lined up to shake his hand and offer apologies. He was the hero in a fairy-tale that had just reached its happy ending, a tale that spoke of his generosity and of Iran's desire for good relations with other nations.
"Just a compulsory vacation," he joked to one of the young sailors, as though they had spent the entire last two weeks playing chess and nibbling pistachio nuts, sitting on red carpets in rooms with floral wall paper - like the scenes in the footage released by Iranian TV.
Well, now they have got back home we have heard a rather different story. Not so much a fairy-tale. More of a nightmare.
Far from straying into Iranian territory, the British crew say they were well within Iraqi waters when Revolutionary Guards rammed their vessels and trained machine guns on them.
Once arrested, they were blindfolded, their hands tied and lined up against a wall, while they could hear the sound of guns being cocked.
In their filmed accounts in Iran, crew members praised Iranians
"Not exactly a mock execution," said one officer stoically, but admitted he had never been so scared in his life.
They were kept isolated, in small cells, subjected to aggressive questioning and what they called "mind games". They were told to confess on camera, or risk up to seven years in jail.
It sounds as though Faye Turney had the worst of it. For four days she thought she was alone, and the others had been sent home.
Once they had all recorded TV interviews, conditions improved. But the footage of them we saw was, they told us, a massive propaganda stunt.
Once the filming was over, they were blindfolded and taken back to their cells. Even after they met the president, they were blindfolded and taken under guard to a hotel.
A holiday, compulsory or otherwise, it was not.
Of course Iran now disputes that account, and claims the sailors' news conference was staged to win propaganda points.
The war of words between the two sides over this saga goes on.
What one can glean about British attempts to solve the crisis is also instructive. Over that two-week period, it went through ups and downs.
From the start, the British government seemed confident the incident was premeditated and the British crew had been arrested illegally.
Mr Blair insisted no deal was done to free the 15 navy personnel
The problem was working out why and persuading Iran to hand them back.
At first the Foreign Office tried quiet diplomacy. But the extended Iranian New Year meant many senior Iranians were unavailable.
"You can't just phone them on your mobile like you can a British minister," complained one official.
London's suspicion was that the different power bases in Tehran would not work out what to do with them until the holiday was over.
Five days in, British patience was wearing thin.
Margaret Beckett called the Iranian foreign minister to warn him Britain was giving Iran until 1230 on Wednesday to act, or it would go public with its evidence and enter - as Tony Blair put it - "a different phase".
From quiet diplomacy Britain abruptly switched to pulling out the stops. Bilateral ties were frozen. Appeals were made to the UN Security Council and to EU foreign ministers to join Britain's protest.
It was a pretty risky strategy. Iran's immediate reaction was to drop the idea of releasing Faye Turney early.
British officials tried to argue that they had never believed the promise anyway.
At the UN, several countries, including Russia, were reluctant to take sides. The final Security Council appeal was watered down and did not even demand the captives' immediate release.
When President Ahmadinejad's dramatic announcement came, the British government was it seems, as stunned as everyone else
It did not look good.
By now Britain was asking anyone it could think of to ratchet up the pressure. Even Syria was asked to help. Even Colombia in Latin America called in the Iranian ambassador.
At one point, apparently, Margaret Beckett's office tried to reach the Iranian foreign minister by phone, to be told by a complaining aide: "Mr Mottaki is having to take quite a lot of calls already as a result of your activities."
Eleven days in, Iran had sent London a note of protest, and London had sent one back, apparently offering to de-escalate the row by talking bilaterally, but British officials were agitated.
With no reply back from Tehran, they seemed unsure what would happen next.
Then, Iran's chief negotiator popped up on British television and signalled that Iran wanted bilateral diplomacy.
Britain seized on this, hoping Iran now wanted to talk, and followed it up with a late night phone call to him from Tony Blair's office.
They hoped talks might start soon. But that was all. Margaret Beckett even publicly warned against a swift resolution.
'In the dark'
So when President Ahmadinejad's dramatic announcement came, the British government was it seems, as stunned as everyone else.
In Tehran, British diplomats rushed to the presidential palace, frantically trying to get access.
The crew said opposing their captors was "not an option"
Foreign journalists exchanged a word with the newly pardoned sailors long before the British ambassador was allowed to see them.
The British government was kept firmly out of the loop, as far as one can tell.
The moral of the tale is that the gap between Iranian claims and what is really going on may be quite great. But do not rely on the British government to have the answer.
Relations between Britain and Iran were strained before this crisis and have probably got worse.
There isn't always a conspiracy or a backroom deal.
Quite often diplomats, like the rest of us, are working in the dark.
From Our Own Correspondent was broadcast on Saturday, 7 April, 2007 at 1130 BST on BBC Radio 4. Please check the programme schedules for World Service transmission times.