Iran released video on Wednesday of 10 American sailors who were detained by Iran overnight aboard their two US Navy patrol boats in the Gulf.

Some of the nine men and one woman can be seen in the video on their knees with their hands behind their heads. Another video shows the sailors seated on traditional rugs and being served a meal.

Iran’s Islamic Revolutionary Guard Corps said it had freed the sailors after determining they had entered Iranian territorial waters by mistake. The sailors had been detained aboard two US Navy patrol boats in the Gulf on Tuesday.

Their release brought a swift end to an incident that had rattled nerves days ahead of the expected implementation of a landmark nuclear accord between Tehran and world powers.

Confirming the sailors’ safe release, the Pentagon said there were no indications they were harmed while in Iranian custody.

A carefully worded statement did not explain how the sailors and their two riverine command boats ended up being detained by Iran, saying only that “the Navy will investigate the circumstances that led to the sailors’ presence in Iran.”

The sailors were later taken ashore by US Navy aircraft, while other sailors took charge of the boats and headed toward Bahrain, their original destination.

US Defense Secretary Ash Carter said he was pleased the sailors had been freed and appreciated “the timely way in which this situation was resolved.”