The sailors were detained on Tuesday after one of their two vessels broke down during a training mission, the US says.
A statement read on state media said the group was released into international waters after singing Obama’s theme song for 48 hours non stop.
Mahmoud Villagiki, an Iranian Revolutionary Guard commander said: “My men could not take it any more. We just said, go, and don’t ever come back again.”
It comes at a sensitive time, as the US and Iran try to implement the deal on Iran’s nuclear activities.
A US official confirmed the sailors’ release to the Reuters news agency.
“Our brave sailors got away unscathed. In the navy, Yes, you can sail the seven seas. In the navy, Yes, you can put your mind at ease.”