(CNN) Seven Indian crew members aboard a British-flagged oil tanker seized by Iran in July are being released, Iranian Foreign Ministry spokesman Abbas Mousavi told state TV on Wednesday.

The Stena Impero was captured by Iran's Revolutionary Guard Corps (IRGC) in the Strait of Hormuz on July 19 amid increasing hostility between Tehran and Washington. Twenty-three crew members -- none of them British -- were on board.

"We don't have any problem with crew and captain of the ship. The ship has been stopped because of its violation of laws and it is natural to detain the crew with the ship," Mousavi said, according to the semi-official Mehr News Agency.

"However, the consular status and individual permits of the crew were reviewed, and after further consideration and also on humanitarian grounds, some of the crew were allowed to leave the ship and return to daily life," he added.

The ship was seized two weeks after the UK detained an Iranian tanker off the coast of Gibraltar. UK authorities released that ship in late August.

Read More