"We lost contact with two small US naval craft en route from Kuwait to Bahrain," the official said.
He said that the Iranians informed the US that the sailors were safe and "will promptly be allowed to continue their journey".
The sailors are likely to be released on Wednesday morning, US officials said.
The incident happened near Farsi Island after one of the ships encountered mechanical problems.
Iran's semi-official news agency FARS reported that the Iranian Revolutionary Guard detained the nine men and one woman, and that they had been "trespassing" and "snooping" in Iranian waters.
After the incident, US Secretary of State John Kerry immediately called Iranian Foreign Minister Javad Zarif to begin negotiations.
An unnamed official told the Associated Press that Mr Kerry "personally engaged with Zarif on this issue to try to get to this outcome".
Mr Kerry and Mr Zarif developed a personal relationship throughout three years of negotiating a nuclear deal.
The conservative Tasnim news agency reported that the American boats were equipped with machine guns.
"Frequent calls by US official urging Tehran to free the detainees continues," reads the Tasnim report.
The Revolutionary Guard has aggressively protected Iranian sea borders in the past.
Fifteen British sailors and marines were held for 13 days in 2007 after they were captured in disputed area between Iran and Iraq.
Tensions between Iran and the US remain despite the breakthrough nuclear deal.
In December, Iran's navy conducted rocket tests near US warships and other commercial vessels in the Strait of Hormuz.
The tests were "highly provocative", a US military commander said at the time.
Iran has detained 10 US sailors after their vessels were stopped in the Gulf, US officials said.