The eight crew members of three UK patrol boats seized by Iran near the border with Iraq are to be released, an Iranian armed forces spokesman says.
The UK has expressed concern over the use of blindfolds
Ali Reza Afshar said "the order for the release of the vessels and their military crew was issued" after UK forces said they had "made a mistake".
However, negotiations continued into the night delaying the release, promised for Wednesday.
The men were detained on Monday in the southern Shatt al-Arab waterway.
The UK Ministry of Defence said the men were training the Iraqi river patrol service, and may have mistakenly strayed over the maritime border.
They appeared on Iranian TV wearing blindfolds and admitting entering Iranian waters illegally.
The Iranian spokesman said the army command was satisfied that the arms and equipment carried in the three British launches had been for use on patrols.
"Considering statements by the British sailors that the boats carrying them mistakenly entered Iran's territorial waters, the armed forces decided to release the boats and their occupants," he told Iranian state radio.
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
Later, Iranian Foreign Minister Kamal Kharrazi was quoted on Wednesday as saying the British crew "will be freed today" [Wednesday].
UK Prime Minister Tony Blair's office said it had received confirmation from the Iranian government that the eight servicemen were being released.
A delegation of UK diplomats has already arrived to meet the men.
However, negotiations were said to be continuing on the route the men would take to get back to their base in Iraq from the remote area of south-western Iran where they were being held.
Iranian officials also said later that the boats and some equipment would be kept behind.
The BBC's Jim Muir reports from Tehran that with talks on the procedures for release continuing well into the night, it is possible the men will not be released until Thursday.
An adviser to President Mohammad Khatami had said the eight men could be freed if there was an official apology from the UK government.
The UK embassy earlier expressed concern that they were shown on television wearing blindfolds, making apologies for entering Iranian territorial waters.
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 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.