The British Service personnel captured by the Iranians were last night preparing to fly home after their 13-day ordeal was suddenly and dramatically brought to a close.
Iran's president, Mahmoud Ahmadinejad, unexpectedly used a news conference in Tehran to announce that he was pardoning the 15 Royal Navy sailors and Royal Marines as "a gift to the British people".
The news was greeted with relief and jubilation by the families of the detainees, while Tony Blair said he was "glad" that they were being released.
In a brief statement outside the door of No 10, the Prime Minister insisted that there had not been any negotiation with the Iranians.
"Throughout, we have taken a measured approach, firm but calm, not negotiating but not confronting either," he said. He thanked Britain's allies in the European Union, the United Nations Security Council and in the region for their support and said he hoped future differences could be resolved through peaceful dialogue.
Following the press conference in Tehran, Iranian television showed Mr Ahmadinejad shaking hands with some of the detainees, before they were handed over to diplomats at the British Embassy.
It was not clear what exactly prompted the Iranians to release the group now.
It followed the announcement last night by Downing Street that contact had been established with the influential head of the Supreme National Security Council, Ali Larijani, who is close to the Supreme Leader, Ayatollah Ali Khamenei.
Despite regular meetings involving officials and diplomats in London and Tehran, the Government had previously struggled to establish an effective channel of communication with the Iranians.
While the conversation - understood to have been with Mr Blair's foreign policy adviser Sir Nigel Sheinwald - was seen as a positive sign, officials were nevertheless taken by surprise by the speed of yesterday's announcement.
Mr Ahmadinejad said at his press conference that Britain had sent a letter to the Foreign Ministry pledging that it would not enter Iranian waters again.
The Foreign Office last night would not discuss details of the diplomatic note it delivered over the weekend, although a spokesman stressed the Government had maintained that the personnel were in Iraqi waters when they were seized.
"We have been quite specific where our boats were," the spokesman said.
Mr Ahmadinejad built up to his release announcement with a lengthy criticism of Britain - including its role in Iraq and Lebanon.
He then awarded a medal to the captain of the patrol boats which captured the British party, before criticising Britain for sending the mother of a small child - Leading Seaman Faye Turney - as part of the crew. "Why is there no respect for motherhood, affection?" he asked.
Key events in hostages drama
Iranian warships seize 15 Royal Navy sailors and Royal Marines as they carry out a routine search of a cargo ship in the northern Persian Gulf.
The Ministry of Defence claims they were in Iraqi territorial waters at the time but Tehran accuses them of "blatant aggression into Iranian territorial waters".
Foreign Office Minister Lord Triesman holds "frank and civil" talks with the Iranian ambassador for more than an hour, demanding the release of the sailors and marines.
Tehran-based Fars news agency claims the group have admitted intruding into Iranian waters and that satellite tracking systems on the British boats prove they were inside Iranian territory.
Prime Minister Tony Blair comments for the first time, describing the incident as a "very serious situation".
He calls for a swift end to the "unjustified and wrong" detention of the sailors and marines. He claims there is "no doubt at all" that the boat was in Iraqi waters when they were seized.
The only woman among the British sailors and marines being held captive is named as Faye Turney, 26.
Mr Blair talks of moving to a "different phase" if diplomatic efforts fail to secure the sailors' release. His official spokesman later says this refers to "a different way" of handling talks.
The Ministry of Defence says it "unambiguously contests" Tehran's claims that the sailors and marines had strayed into Iranian waters.
A letter said to be written by Leading Seaman Turney to her parents is released, in which she admits that they had "apparently" crossed into Iranian waters. Iranian television screens footage of the 15 captured personnel apparently well and eating a meal. Leading Seaman Turney is filmed saying that they had "obviously" trespassed into Iranian waters.
Iran releases a second letter said to have been written by Leading Seaman Turney and addressed to "representatives of the House of Commons" and states: "Isn't it time for us to start withdrawing our forces from Iraq and let them determine their own future?"
The British Embassy in Tehran receives a note from the Iranian government accusing the Royal Navy party of committing an "illegal act" and calling for a "guarantee to avoid the recurrence of such acts". Iranian TV screens footage of British serviceman Nathan Thomas Summers, who is shown saying: "I would like to apologise for entering your waters without any permission."
Iranian President Mahmoud Ahmadinejad tells a news conference in Tehran the 15 naval personnel will be released as a "gift to Britain".