The eight British servicemen held in Iran since Monday have been released, the UK government has said.
The eight men were released on Thursday morning
The six Royal Marines and two sailors were flown to Tehran and have now been taken to the British embassy compound in the Iranian capital.
The men were seized in the Shatt al-Arab waterway, where they were training the Iraqi river patrol service.
British officials have said that the men may have mistakenly strayed over the maritime border.
The men were released at 0830BST on Thursday and arrived in Tehran around 90 minutes later.
UK Foreign Secretary Jack Straw welcomed their release.
THE SHATT AL-ARAB
120 miles of tidal waterway
Formed by Tigris and Euphrates rivers
Subject to 1639 Persian-Ottoman treaty
Southern stretch forms border between Iraq and Iran
River is vital trade route for both countries
Control of river one of disputes causing Iran-Iraq war in 1980
"I'm obviously very pleased indeed, as, I know, their families and service colleagues will be, that they are now in British care," he said.
Mr Straw defended the fact that it has taken four days to secure the release of the men.
"These things do sometimes take time," he said.
Downing Street also welcomed the men's release.
"We are glad that the matter has been able to be resolved diplomatically," said Prime Minister Tony Blair's official spokesman.
"The important thing now is to get the servicemen, when they are ready, out of Tehran back to their base in Iraq."
The servicemen are thought to come from two Scotland-based units - Arbroath-based 45 Commando and the Fleet Standby Rifle Troop from Faslane on the Clyde - and from the 539 Assault Squadron in Plymouth, south-west England.
The father of one of the men said he was "absolutely delighted" they had been released.
"It's the news we've been waiting for," said Graham Reid, whose 24-year-old son David was among those detained.
"There were some dark moments over the last few days, especially when we saw them on TV blindfolded, but this is brilliant.
"Hopefully we'll see him either late tonight or early tomorrow, I can't wait to just see him and give him a hug."
Days of talks
Their release follows three days of talks between British diplomats and Iranian officials.
Iran had initially said it would prosecute the men for illegally entering Iranian territory.
The men appeared on Iranian TV wearing blindfolds earlier in the week and admitted entering Iranian waters illegally.
British diplomats visited the men on Wednesday. They said they were all fit and well and in pretty good spirits. They said the men were not being kept blindfolded.
The naval launches, the arms and equipment that the British servicemen had with them have not been handed over.
Mr Straw said these would be matters "for further discussion".
The arrests came at a time of strained relations between the UK and Iran.
Iranian hardliners have staged a series of angry demonstrations outside the British embassy in Tehran in recent weeks to protest at the occupation of Iraq.
Britain has also been strongly criticised too for its role in helping draft a tough resolution on Iran at the International Atomic Energy Agency in Vienna last week.