Iranian state television has released footage of the arrest of the nine men and one woman
Iranian state television has shown the moment 10 American sailors were arrested after their boats allegedly strayed into Iranian waters.
The footage shows the Americans kneeling on board a US-flagged vessel with their hands behind their heads.
Additional footage showed the sailors sitting on the floor in a room and eating.
The nine men and one woman were interrogated and held overnight on Farsi Island in the Gulf, where the Iranian Revolutionary Guards Corps (IRGC) have a base.
They were allowed to leave unharmed on Wednesday, both Iran and the US confirmed.
US Secretary of State John Kerry thanked Iran for its "cooperation" in the matter, which occurred just days before Tehran is expected to comply with the terms set in last summer's nuclear deal.
Delivering a speech on US foreign policy, Mr Kerry said the peaceful resolution was a "testament to the critical role that diplomacy plays" in keeping the US safe.
The Pentagon said the US Navy was investigating how the sailors came to be in Iranian waters.
It lost contact with the patrol boats as they moved through the Gulf between Kuwait and Bahrain on Tuesday.
Both Washington and Tehran have blamed the incident on "mechanical problems" following conflicting messages from the Iranians, who initially accused the sailors of spying.
In a statement posted online, Iran's Revolutionary Guard said: "After determining that their entry into Iran's territorial waters was not intentional and their apology, the detained American sailors were released in international waters."
Footage aired on Iranian TV showed one US sailor issuing an apology while still in custody.
"It was a mistake that was our fault and we apologise for our mistake," said the sailor identified as a commanding officer.
US Vice President Joe Biden, however, told the CBS This Morning news programme that Washington would not apologise.
He said: "There's nothing to apologise for. When you have a problem with the boat you apologise the boat had a problem?
"No, and there was no looking for any apology. This was just standard nautical practice."
State Department spokesman John Kirby echoed Mr Biden's comments on Twitter, saying there was "absolutely zero truth" to rumours that Mr Kerry apologised to Iran.
"Nothing to apologize for", Mr Kirby tweeted.
The tension rattled nerves days ahead of the expected implementation of July's landmark nuclear accord with Tehran, which Mr Kerry helped broker with Iranian Foreign Minister Mohammed Javad Zarif.
The White House credited new lines of communications established with Tehran during the nuclear negotiations as key to securing the sailors' quick release.
Mr Kerry called Mr Zarif immediately on learning of the sailors' detention, a senior US official told the AP news agency.
White House chief of staff Denis McDonough said the relationship between the two diplomats was key to resolving the matter, and US defence chief Ash Carter thanked Mr Kerry for his efforts.
President Barack Obama was briefed on the situation just hours before he delivered his final State of the Union address to Congress.
Tuesday's incident follows Iran's launch of a test rocket near US warships passing through the Strait of Hormuz in late December.
In March 2007, Iranian forces seized 15 British servicemen in the mouth of a waterway separating Iran and Iraq.
They were held for 13 days, in a diplomatic crisis that at the time bordered on farce.