The crew were on their way to take part in the Dubai-Muscat yacht race
Five British yachtsmen held by Iran's Revolutionary Guard for a week have been released, the UK has confirmed.
The crew are said to have drifted into Iranian waters mistakenly while sailing from Bahrain to Dubai for a race.
Foreign Secretary David Miliband said the men had left the island of Siri and were heading for international waters.
A statement by the Revolutionary Guard said interrogations had revealed their "illegal entry" had been "a mistake". Relatives have told of their relief.
Luke Porter, 21, from Weston-super-Mare, Somerset, Oliver Smith, 31, from Southampton, Oliver Young, 21, from Saltash, Cornwall, Sam Usher, 26, from Scarborough, North Yorkshire, and Bahrain-based David Bloomer, who is believed to be in his 60s, were held on 25 November.
A Foreign Office statement said: "We understand that they are being towed to international waters and will be met by a representative from the sailing company."
The BBC has spoken to Nick Crabtree, the Sail Bahrain team leader, who is on-board the yacht with the sailors.
He said they are currently being towed to Dubai on their yacht and that all are well and safe and in good condition.
Luke Porter's parents say they are elated after news of his release
Iranian radio said the five had been freed at 0730 local time (0400 GMT).
Iran's official IRNA news agency said they had been released after an interrogation by authorities established that their yacht had entered Iranian waters accidentally.
A statement by Iran's Revolutionary Guard said: "After carrying out an investigation and interrogation of the five British sailors, it became clear that their illegal entry was a mistake.
"After obtaining necessary guarantees, it was decided to release them."
Mr Miliband told reporters it had been "a purely consular case" and said he was pleased that the matter had been dealt with in a "professional and straightforward way" by the Iranian authorities.
By Jon Leyne, BBC Tehran correspondent
At the best of times, the Iranian government suspects the outside world is preoccupied with trying to undermine it.
That obsession has come close to paranoia, as Iran takes on the West over its nuclear programme.
Within the Iranian government, there is also likely to have been some discussion over whether the captured British yachtsmen could be exploited for propaganda purposes, as the Royal Navy sailors and Marines were when they were held two years ago.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.