UPDATE: Iranian state media reports that all 10 detained US Navy sailors were freed Wednesday morning.
The detention of 10 U.S. Navy sailors taken into custody by Tehran after their two boats drifted into Iranian waters "is being resolved," a leading Iranian official said, indicating they could be set free as early as Wednesday.
"Investigation shows that entry of American sailors into Iran's territorial waters was due to mechanical problems in their navigation system," Gen. Ali Fadavi, Navy chief of Iran's powerful Revolutionary Guard, was quoted as saying on Iran's state TV.
U.S. officials had said on Tuesday that Tehran assured them the crew and vessels would be returned safely and promptly.
Earlier Wednesday, Fadavi said the American boats had shown "unprofessional acts" for 40 minutes before being picked up by Iranian forces after entering the country's territorial waters.
The U.S. detainees included nine men and one woman, who were being held overnight at an Iranian base on Farsi Island in the Persian Gulf. They were expected to be transferred Wednesday to a U.S. ship in the region.
"US naval force and their frigate showed an unprofessional behavior and had air and naval moves for 40 minutes in the area," Fadavi said at one point. He said Tehran did not consider the U.S. Navy boats violating Iranian territorial waters as "innocent passage."
"Certainly US presence in Persian Gulf and their passage has never been innocent and we do not deem their passage as innocent," he said.
Fadavi said Iranian Foreign Minister Mohammed Javad Zarif "had a firm stance" during a telephone conversation with U.S. Secretary of State John Kerry "on their presence in our territorial waters and said they should not have come and should apologize."
"This process is underway now and will not last long. The Guard naval force will carry out orders of top commanders regarding this case as soon as we receive them," he said.
Gen. Ramezan Sharif, spokesman for the Guard, said the U.S. military personnel were to be debriefed.
"If it is determined, after the investigation is carried out, that their action was not intentional, another approach will be taken," he said. "But If it's determined, after they are debriefed and interviewed, that their entry (into Iran's territorial waters) was for intelligence gathering or irrelevant action, definitely the authorities will take the necessary measures."
Pentagon spokesman Peter Cook told The Associated Press late Tuesday U.S. time that the Riverine boats were moving between Kuwait and Bahrain when the U.S. lost contact with them.
U.S. officials said that the incident happened near Farsi Island in the middle of the Gulf. They said some type of mechanical trouble with one of the boats caused them to drift into Iranian territorial waters near the island, and they were picked up by Iran.
"We have been in contact with Iran and have received assurances that the crew and the vessels will be returned promptly," Cook said late Tuesday, U.S. time.
The incident came amid heightened tensions with Iran, and only hours before President Barack Obama gave his final State of the Union address to Congress and the public. It set off a dramatic series of calls and meetings as U.S. officials tried to determine the exact status of the crew and reach out to Iranian leaders.
Kerry, who forged a personal relationship with Zarif through three years of nuclear negotiations, called his Iranian counterpart immediately on learning of the incident, according to a senior U.S. official. Kerry "personally engaged with Zarif on this issue to try to get to this outcome," the official said.
Kerry learned of the incident around 12:30 p.m. EST as he and Defense Secretary Ash Carter were meeting their Filipino counterparts at the State Department, the official said.
Officials said the sailors were part of Riverine Squadron 1 based in San Diego and were deployed to the U.S. Navy's 5th Fleet in Bahrain. When the U.S. lost contact with the boats, ships attached to the USS Harry S Truman aircraft carrier strike group began searching the area, along with aircraft flying off the Truman.
Officials said a radio signal from one of the boats showed that they were on Farsi Island, setting off efforts to contact the Iranians. The Riverine boats were not part of the carrier strike group, and were on a training mission as they traveled between Kuwait and Bahrain, officials said.
The Riverine boats are not considered high-tech and don't contain any sensitive equipment, so there were no concerns about the Iranians gaining access to the crafts.
The officials were not authorized to discuss the sensitive incident publicly so spoke on condition of anonymity.
The incident came on the heels of an incident in late December when Iran launched a rocket test near U.S. warships and boats passing through the Strait of Hormuz.
Meanwhile, Iran was expected to satisfy the terms of last summer's nuclear deal in just days. Once the U.N. nuclear agency confirms Iran's actions to roll back its program, the United States and other Western powers are obliged to suspend wide-ranging oil, trade and financial sanctions on Tehran. Kerry recently said the deal's implementation was "days away."
Associated Press writers Matthew Lee, Lolita C. Baldor, Bradley Klapper and Richard Lardner in Washington and Nasser Karimi and Ali Akbar in Tehran contributed to this report.