Mahmoud Ahmadinejad announced this afternoon that the 15 British sailors seized by Iran two weeks ago are to be freed, as a "gift" to Britain.
At a speech in Teheran the Iranian president said the party would be "pardoned", despite Britain's refusal to admit that they had entered Iranian waters.
He gave no further details of their release and - unlike in previous statements - did not attach any conditions.
A recent flurry of diplomatic activity between London and Teheran had raised hopes that progress was being made towards a solution, but today's sudden announcement still came as a shock.
During his speech Mr Ahmadinejad also praised the Revolutionary Guards who had captured the sailors in the Persian Gulf, and attacked the British government for failing to have the courage to admit it had been wrong about the location of the British party.